Re: [Dancer-users] Allow alternate path in Dancer::Logger::File? (Flavio Poletti)
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@perldancer.org Sender: dancer-users-bounces@perldancer.org Date: Thu, 28 Oct 2010 12:00:01 To: <dancer-users@perldancer.org> Reply-To: dancer-users@perldancer.org Subject: Dancer-users Digest, Vol 8, Issue 23 Send Dancer-users mailing list submissions to dancer-users@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@perldancer.org You can reach the person managing the list at dancer-users-owner@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@cpan.org> Subject: [Dancer-users] Plat_Forms 2011 programming contest To: dancer-users@perldancer.org Message-ID: <201010271535.21095.daxim@cpan.org> Content-Type: text/plain; charset="utf-8" Crossposted: catalyst@lists.scsys.co.uk, dancer-users@perldancer.org, mojolicious@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@donor.com> Subject: [Dancer-users] Allow alternate path in Dancer::Logger::File? To: dancer-users@perldancer.org Message-ID: <AANLkTikufya_=i-H4d=LT9hPyHxpPdS9NjcZJf=_xfpK@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@gmail.com> Subject: Re: [Dancer-users] Allow alternate path in Dancer::Logger::File? To: Mike Schroeder <mike@donor.com> Cc: dancer-users@perldancer.org Message-ID: <AANLkTimCWfsdkPXV2GLr2ny8p_boz6x0bGVCy3zdkk2L@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@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@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@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users End of Dancer-users Digest, Vol 8, Issue 23 *******************************************
Hi, I'm trying to run my Dancer app using Starman, eg: $ plackup -s Starman ./App.pl 2010/11/01-17:03:19 Starman::Server (type Net::Server::PreFork) starting! pid(5175) Binding to TCP port 5000 on host * Setting gid to "1002 1002 27 1002" Starman: Accepting connections at http://*:5000/ When I browse my app, most of the time the page renders without the CSS file. Occasionally it works correctly. If I browse directly to the css file (/css/style.css), it seems to be served ok. If I use Plack without Starman it all works fine. Any ideas whats happening? Cheers, Nick
participants (2)
-
awnstudio@gmail.com -
nick langridge