[Dancer-users] Allow alternate path in Dancer::Logger::File? (Flavio Poletti)

awnstudio at gmail.com awnstudio at gmail.com
Thu Oct 28 01:21:04 CEST 2010


I agree that log path should be  configurable, I think the configuration option should be uniform, e.g. session_dir, log_dir, etc. Actually I think all paths should be configurable. Suppose I have two seperate application I want to share the same config.yml or environment file, ...

--Al

Sent from my Verizon Wireless BlackBerry

-----Original Message-----
From: dancer-users-request at perldancer.org
Sender: dancer-users-bounces at perldancer.org
Date: Thu, 28 Oct 2010 12:00:01 
To: <dancer-users at perldancer.org>
Reply-To: dancer-users at perldancer.org
Subject: Dancer-users Digest, Vol 8, Issue 23

Send Dancer-users mailing list submissions to
	dancer-users at perldancer.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
or, via email, send a message with subject or body 'help' to
	dancer-users-request at perldancer.org

You can reach the person managing the list at
	dancer-users-owner at perldancer.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Dancer-users digest..."


Today's Topics:

   1. Plat_Forms 2011 programming contest (Lars D?????? ???)
   2. Allow alternate path in Dancer::Logger::File? (Mike Schroeder)
   3. Re: Allow alternate path in Dancer::Logger::File? (Flavio Poletti)


----------------------------------------------------------------------

Message: 1
Date: Wed, 27 Oct 2010 15:35:20 +0200
From: Lars D?????? ??? 	<daxim at cpan.org>
Subject: [Dancer-users] Plat_Forms 2011 programming contest
To: dancer-users at perldancer.org
Message-ID: <201010271535.21095.daxim at cpan.org>
Content-Type: text/plain; charset="utf-8"

Crossposted: catalyst at lists.scsys.co.uk, dancer-users at perldancer.org, 
mojolicious at googlegroups.com, http://perl-community.de/bat/poard/thread/15495

Hello Perl web programmers,

the organisers of the [Plat_Forms contest](http://plat-forms.org/) have 
published the call for application. See the [announcement overview]
(http://plat-forms.org/platforms-announcement#overview) for why this contest 
is very important for the community as a whole.

Perl's esteem is at stake. ? Up to 4 teams comprised of 3 members each are 
needed to represent our favourite programming language. Like in the preceding 
contest in 2007, the Perl teams are likely self-organised and not company-
backed. To facilitate that, I have set up [a page on the official Perl 5 wiki]
(https://www.socialtext.net/perl5/index.cgi?events_2011_plat_forms).

Action required:

1. Communicate as you see fit and form more teams.
2. Post summaries to the wiki page to keep everyone updated.
3. Fill in the [application form](http://plat-
forms.org/sites/default/files/Plat_Forms-applicationform.pdf) and snail-mail 
it to the organisers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20101027/7df79238/attachment-0001.pgp>

------------------------------

Message: 2
Date: Wed, 27 Oct 2010 12:11:07 -0600
From: Mike Schroeder <mike at donor.com>
Subject: [Dancer-users] Allow alternate path in Dancer::Logger::File?
To: dancer-users at perldancer.org
Message-ID:
	<AANLkTikufya_=i-H4d=LT9hPyHxpPdS9NjcZJf=_xfpK at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Currently the logdir() method in Dancer::Logger::File looks like:

sub logdir {
    my $appdir = setting('appdir');
    my $logroot = $appdir || File::Spec->tmpdir();
    return path($logroot, 'logs');
}


However, our production environments all mount off read-only
filesystems, so having logging dependant on appdir won't work. I can
write a new logger module that does something like:


sub logdir {
    my $appdir = setting('appdir');
    my $altpath = setting('log_path');
    my $logroot = $appdir || File::Spec->tmpdir();
    return ( $altpath ? $altpath : path($logroot, 'logs') );
}


Is that something that is worth going into the core?  I'm fine either way,
but I thought this might be useful to others in the future.

Thanks.

Mike.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20101027/acb47d30/attachment-0001.htm>

------------------------------

Message: 3
Date: Thu, 28 Oct 2010 11:42:15 +0200
From: Flavio Poletti <polettix at gmail.com>
Subject: Re: [Dancer-users] Allow alternate path in
	Dancer::Logger::File?
To: Mike Schroeder <mike at donor.com>
Cc: dancer-users at perldancer.org
Message-ID:
	<AANLkTimCWfsdkPXV2GLr2ny8p_boz6x0bGVCy3zdkk2L at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

As a quick workaround, if your read-only filesystem (and your OS too!)
supports linking you could make 'logs' point to the directory you really
want to use for logs. 99% of chances that you had a good reason not to do
that, but sometimes it's difficult to see the wood if one is concentrating
on the trees.

Personally, I would rewrite your sub as follows:

sub logdir {
    my $altpath = setting('log_path');
    return $altpath if $altpath;

    my $appdir = setting('appdir');
    my $logroot = $appdir || File::Spec->tmpdir();
    return path($logroot, 'logs');
}

I see no reason to possibly create a temporary directory if you don't really
need to.

Cheers,

   Flavio.


On Wed, Oct 27, 2010 at 8:11 PM, Mike Schroeder <mike at donor.com> wrote:

> Currently the logdir() method in Dancer::Logger::File looks like:
>
> sub logdir {
>     my $appdir = setting('appdir');
>     my $logroot = $appdir || File::Spec->tmpdir();
>     return path($logroot, 'logs');
> }
>
>
> However, our production environments all mount off read-only filesystems, so having logging dependant on appdir won't work. I can write a new logger module that does something like:
>
>
> sub logdir {
>     my $appdir = setting('appdir');
>     my $altpath = setting('log_path');
>     my $logroot = $appdir || File::Spec->tmpdir();
>     return ( $altpath ? $altpath : path($logroot, 'logs') );
> }
>
>
> Is that something that is worth going into the core?  I'm fine either way,
> but I thought this might be useful to others in the future.
>
> Thanks.
>
> Mike.
>
>
>
> _______________________________________________
> Dancer-users mailing list
> Dancer-users at perldancer.org
> http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20101028/76dcb22b/attachment-0001.htm>

------------------------------

_______________________________________________
Dancer-users mailing list
Dancer-users at perldancer.org
http://www.backup-manager.org/cgi-bin/listinfo/dancer-users


End of Dancer-users Digest, Vol 8, Issue 23
*******************************************


More information about the Dancer-users mailing list