On Tue, 24 Mar 2009, Peter McAlpine wrote:

> I've encountered a problem with Log::Dispatch::FileRotate when running
> multiple processes sharing the same log.

Hi Peter,

Log::Dispatch::FileRotate isn't part of the Log4perl distribution, it's
a 3rd party module maintained by Mark Pfeiffer:

     http://search.cpan.org/~markpf/Log-Dispatch-FileRotate-1.19/

What you're describing sounds like a locking problem on the Win32
platform, it's probably best if you file a bug on

     http://rt.cpan.org/Public/Dist/Display.html?Name=Log-Dispatch-FileRotate

to get Mark's attention.

Thanks!

-- Mike

Mike Schilli
m...@perlmeister.com

> My script to reproduce are below.  The script simply log the date
> every second and rotate every 5 seconds (this issue exists for daily
> rotation, too, which is how I first noticed it). It works fine if you
> run a single process, but then as soon as a launch another "nolog.pl"
> instance the existing logfiles are deleted except for the one with the
> largest number, and no more rotation happens.
>
> This issue exists on win xp and server 2003, activeperl 5.8.8, log4perl
> 1.15, FileRotate.pm version 1.15, and also FileRotate.pm version 1.19.
> The issue DOES NOT exist on linux (debian etch) perl 5.8.8, log4perl 1.07,
> FileRotate.pm 1.19.
>
> Any help you can provide in resolving this would be greatly appreciated.
> -Peter
>
> #! /usr/bin/perl -w
> # nolog.pl
>
> use strict;
> use warnings;
> use Log::Log4perl qw(:levels get_logger);
>
> Log::Log4perl->init_and_watch('log4perl.conf', 30);
> my $log = get_logger('root');
> $log->info("init");
>
> while (1) {
>    $log->info(gmtime);
>    sleep(1);
> }
>
> $log->info("never here");
>
> # log4perl.conf
> log4perl.logger.root = TRACE,log1,console
>
> # output to stderr
> log4perl.appender.console = Log::Log4perl::Appender::Screen
> log4perl.appender.console.stderr = 1
> log4perl.appender.console.layout = Log::Log4perl::Layout::PatternLayout
> log4perl.appender.console.layout.ConversionPattern = %d %c - %p - %m%n
> log4perl.appender.console.Threshold = INFO
>
> # output to log file
> log4perl.appender.log1 = Log::Dispatch::FileRotate
> log4perl.appender.log1.filename = logs/log1.txt
> log4perl.appender.log1.mode = append
> log4perl.appender.log1.min_level = info
> log4perl.appender.log1.max = 5
> log4perl.appender.log1.DatePattern = 0:0:0:0:0:0:5
> log4perl.appender.log1.TZ = EDT
> log4perl.appender.log1.layout = Log::Log4perl::Layout::PatternLayout
> log4perl.appender.log1.layout.ConversionPattern = %d %c - %p - %m%n
>

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
log4perl-devel mailing list
log4perl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/log4perl-devel

Reply via email to