You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(38) |
Sep
(126) |
Oct
(23) |
Nov
(72) |
Dec
(36) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(76) |
Feb
(32) |
Mar
(19) |
Apr
(6) |
May
(54) |
Jun
(40) |
Jul
(45) |
Aug
(35) |
Sep
(51) |
Oct
(67) |
Nov
(10) |
Dec
(50) |
| 2004 |
Jan
(51) |
Feb
(22) |
Mar
(22) |
Apr
(28) |
May
(53) |
Jun
(99) |
Jul
(38) |
Aug
(49) |
Sep
(23) |
Oct
(29) |
Nov
(30) |
Dec
(48) |
| 2005 |
Jan
(15) |
Feb
(21) |
Mar
(25) |
Apr
(16) |
May
(131) |
Jun
|
Jul
(8) |
Aug
(5) |
Sep
(15) |
Oct
|
Nov
(15) |
Dec
(12) |
| 2006 |
Jan
(15) |
Feb
(20) |
Mar
(8) |
Apr
(10) |
May
(3) |
Jun
(16) |
Jul
(15) |
Aug
(11) |
Sep
(17) |
Oct
(27) |
Nov
(11) |
Dec
(12) |
| 2007 |
Jan
(19) |
Feb
(18) |
Mar
(33) |
Apr
(4) |
May
(15) |
Jun
(22) |
Jul
(19) |
Aug
(20) |
Sep
(14) |
Oct
(4) |
Nov
(34) |
Dec
(11) |
| 2008 |
Jan
(8) |
Feb
(18) |
Mar
(2) |
Apr
(4) |
May
(26) |
Jun
(9) |
Jul
(8) |
Aug
(8) |
Sep
(3) |
Oct
(17) |
Nov
(14) |
Dec
(4) |
| 2009 |
Jan
(6) |
Feb
(41) |
Mar
(21) |
Apr
(10) |
May
(21) |
Jun
|
Jul
(8) |
Aug
(4) |
Sep
(3) |
Oct
(8) |
Nov
(6) |
Dec
(5) |
| 2010 |
Jan
(14) |
Feb
(13) |
Mar
(7) |
Apr
(12) |
May
(4) |
Jun
(1) |
Jul
(11) |
Aug
(5) |
Sep
|
Oct
(1) |
Nov
(10) |
Dec
|
| 2011 |
Jan
(7) |
Feb
(3) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(1) |
Jul
(6) |
Aug
(6) |
Sep
(10) |
Oct
(5) |
Nov
(4) |
Dec
(5) |
| 2012 |
Jan
(4) |
Feb
(5) |
Mar
(1) |
Apr
(7) |
May
(1) |
Jun
|
Jul
(2) |
Aug
|
Sep
(5) |
Oct
(5) |
Nov
(4) |
Dec
(5) |
| 2013 |
Jan
(6) |
Feb
|
Mar
(14) |
Apr
(9) |
May
(3) |
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
(4) |
Dec
(6) |
| 2014 |
Jan
|
Feb
(1) |
Mar
(10) |
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
(1) |
Nov
|
Dec
(4) |
| 2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
|
From: Andreas A. <alt...@mi...> - 2009-04-28 15:55:01
|
Hi, is there a possibility to increase the log level when an error occurs and print passed logs with the increased log level? This would be very handy if you have a server application running, with a very low log level, to produce as less logging data as necessary. But once an error occurs this data is not sufficient. It would be nice to log additionally to the stack backtrace all the passed logs with a higher log level. I know that the log output would be buffered. This would mean that even though a logging event occured there'll be no output immediately. There might even be security concerns because the logging data might get lost, if the server crashes, before the buffer has been flushed. But nevertheless this is probably a good feature for server applications where real time logging is not the top priority. Regards, Andreas |
|
From: Jens B. <log...@je...> - 2009-04-21 19:39:10
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Mike Schilli wrote:<br> <br> >> I added a new test script for this behaviour and a possible patch to<br> >> Synchronized (Log4perl version 1.21).<br> ><br> >Looks good, I've applied it to the git repo (we're in the process of<br> >migrating to github).<br> <br> Great! Altough my changes were tiny, it still feels good to collaborate in such a useful project like log4perl.<br> <br> > Okay, I've cleaned it up a bit and added some documentation on how to<br> > initialize composite appenders with the API:<br> ><br> > <a class="moz-txt-link-freetext" href="http://github.com/mschilli/log4perl/commit/da3f88ed6e556418685b367674384e4076c9d261">http://github.com/mschilli/log4perl/commit/da3f88ed6e556418685b367674384e4076c9d261</a><br> <br> Thank you, this will simplify my code. Now it's a clean thing to do the API initialization.<br> Thank you for the documentation, too.<br> <br> Best wishes aus der alten Heimat ;-)<br> Jens<br> <br> </body> </html> |
|
From: Mike S. <m...@pe...> - 2009-04-20 07:01:48
|
On Sun, 12 Apr 2009, Mike Schilli wrote: > which is most certainly terrible and, as mentioned above, needs to be > fixed in one of the upcoming Log4perl releases. Okay, I've cleaned it up a bit and added some documentation on how to initialize composite appenders with the API: http://github.com/mschilli/log4perl/commit/da3f88ed6e556418685b367674384e4076c9d261 -- Mike Mike Schilli m...@pe... |
|
From: Mike S. <m...@pe...> - 2009-04-13 05:18:04
|
On Thu, 9 Apr 2009, Jens Berthold wrote:
> 1) The sub Log::Log4perl::Appender::Synchronized->post_init() is not
> called when the appender is created via API. Is this correct? My way
> to handle this was to write an own class derived from Synchronized an
> copy the code from post_init() to new().
Hi Jens,
as you've noticed, the internal function create_appender_instance()
performs some magic that makes composite appenders work, but this method
isn't suited in its current form to be used from the outside. I'll dig
into the internals to find a way to fix this.
As it is now, you'd have to do something like
use Log::Log4perl qw(get_logger :levels);
my $fileApp = Log::Log4perl::Appender->new(
'Log::Log4perl::Appender::File',
name => 'MyFileApp',
filename => 'mylog',
mode => 'append',
);
$fileApp->layout(
Log::Log4perl::Layout::PatternLayout::Multiline->new(
'%d{yyyy-MM-dd HH:mm:ss} %p [%c] #%P> %m%n')
);
$Log::Log4perl::Logger::APPENDER_BY_NAME{"MyFileApp"} = $fileApp;
my $syncApp = Log::Log4perl::Appender->new(
'Log::Log4perl::Appender::Synchronized',
name => 'MySyncApp',
appender => 'MyFileApp',
key => 'nem',
);
$syncApp->post_init();
$syncApp->composite(1);
get_logger("")->add_appender($syncApp);
get_logger("")->level($DEBUG);
get_logger("wonk")->debug("waah!");
which is most certainly terrible and, as mentioned above, needs to be
fixed in one of the upcoming Log4perl releases.
One more thing: Is there a reason why you're using 'syswrite' and the
Synchronized appender in combination? By using 'syswrite', you won't
need the Synchronized appender at all, because the OS will make sure
that messages will be written out entirely without overlap.
> 3) When initialising Log::Log4perl::Appender::Synchronized before
> forking child processes, eventually all existing processes try to remove
> the semaphore.
> I could only solve this with a derived class that stores the process id
> of the parent and only allowed the parent to remove the semaphore.
Hmm, this sounds like a bug, but I'm not sure what your 'existing'
processes are doing in this case -- can you provide some test code?
-- Mike
Mike Schilli
m...@pe...
|
|
From: Jens B. <log...@je...> - 2009-04-09 21:29:31
|
Hi,
I am new to this list and hope this is the right place for my questions.
I am using Log4perl in a server project with parent and child processes.
And it's great, of course ;-)
Due to an initialization of log4perl that has multiple steps I recently
switched from text based initialization to API calls.
Three problems occured:
1) The sub Log::Log4perl::Appender::Synchronized->post_init() is not
called when the appender is created via API.
Is this correct?
My way to handle this was to write an own class derived from
Synchronized an copy the code from post_init() to new().
2) How to correctly configure a composite appender via API?
Concrete: How to create an appender which is not connected to any logger
and register it in a composite appender?
(It seems that there is no alternative to the code used in
Log::Log4perl::Config->create_appender_instance(), line 402)
Following code works, but results in double log entries in the file:
my $fileApp = Log::Log4perl::Appender->new(
'Log::Log4perl::Appender::File',
name => 'MyFileApp',
filename => '/tmp/mylog',
mode => 'append',
syswrite => 1,
);
$fileApp->layout(
Log::Log4perl::Layout::PatternLayout::Multiline->new('%d{yyyy-MM-dd
HH:mm:ss} %p [%c] #%P> %m%n')
);
$this->logger->get_root_logger()->add_appender($fileApp);
my $syncApp = Log::Log4perl::Appender->new(
'Log::Log4perl::Appender::Synchronized',
name => 'MySyncApp',
appender => 'MyFileApp',
key => 'nem',
);
$this->logger->get_root_logger()->add_appender($syncApp);
3) When initialising Log::Log4perl::Appender::Synchronized before
forking child processes, eventually all existing processes try to remove
the semaphore.
I could only solve this with a derived class that stores the process id
of the parent and only allowed the parent to remove the semaphore.
I'm struggling with these problems for 4 days now and would appreciate
any answer!
But for the time being: I wish you a very Happy Easter!
Regards,
Jens Berthold
|
|
From: Mike S. <m...@pe...> - 2009-04-02 06:17:38
|
On Thu, 2 Apr 2009, Ben Humphreys wrote:
> If anyone else is interested, I merged the data using Hash::Merge, and
> it seems to have the behaviour I was looking for. Pretty concise too.
That's a great idea, Log4perl should really come with something like
this right out of the box!
-- Mike
Mike Schilli
m...@pe...
>
>
> use Data::Dumper;
> use Hash::Merge qw( merge );
> use Log::Log4perl::Config;
> use Log::Log4perl::Config::PropertyConfigurator;
>
> my $user_conf = Log::Log4perl::Config::PropertyConfigurator->new();
> $user_conf->file("s4:[bhumphreys.cube.exg.kosdaq]log.conf");
> my $user_data = $user_conf->parse(); # will die() on error
> print Dumper($user_data);
>
> my $def_conf = Log::Log4perl::Config::PropertyConfigurator->new();
> $def_conf->file("s4:[bhumphreys.cube_dev.lib]default_logger.conf");
> my $defaults = $def_conf->parse(); # will die() on error
> print Dumper($defaults);
>
> Hash::Merge::set_behavior( 'LEFT_PRECEDENT' );
> my %results = %{ merge( $user_data, $defaults ) };
>
> print Dumper(\%results);
>
>
>
>
>
> From:
> Mike Schilli <m...@pe...>
> To:
> Ben Humphreys <bhu...@fa...>
> Cc:
> log...@li...
> Date:
> 01/04/2009 01:41
> Subject:
> Re: [log4perl-devel] Multiple Config Files, or Default Behaviour
> Workarounds?
>
>
>
> On Tue, 31 Mar 2009, Ben Humphreys wrote:
>
>> I want a default base set up for the logs, for formatting and levels
>> of explicit-ness, but I also want users to be able to override certain
>> parts of this behaviour with config files.
>> I can imagine doing the default behaviour in Perl, and then loading the
>> config file, but I'm not sure if that will trash all the default
> settings.
>> Or there is the string merge idea from the link above, but that seems a
>> little tricky.
>
> If you want to make sure that your settings have precedence, you need to
> load the user configuration file first and then make the corrections.
> The other way around, their configuration will override yours.
>
> One way to 'merge' two configurations to use the parse() method of the
> Log::Log4perl::Config::PropertyConfigurator class:
>
> use Data::Dump qw(dump);
> use Log::Log4perl::Config;
> use Log::Log4perl::Config::PropertyConfigurator;
> my $conf = Log::Log4perl::Config::PropertyConfigurator->new();
> $conf->file("l4p.conf");
> my $data = $conf->parse(); # will die() on error
> print dump($data);
>
> After that (and note that parse() will die() if there's an error, so you
> might want to use an eval {} around it), $data will contain a data
> structure that you then can modify and merge with another one obtained
> from a second file.
>
> Once you have a satisfactory data structure in $data, you can pass it as
> the second (!) argument to Log4perl's init function:
>
> Log::Log4perl->init( undef, $data );
>
> Highly undocumented feature ;).
>
> Hope that helps!
>
> -- Mike
>
> Mike Schilli
> m...@pe...
>
>
>
|
|
From: Ben H. <bhu...@fa...> - 2009-04-01 23:37:17
|
Thanks for the help!
If anyone else is interested, I merged the data using Hash::Merge, and it
seems to have the behaviour I was looking for.
Pretty concise too.
use Data::Dumper;
use Hash::Merge qw( merge );
use Log::Log4perl::Config;
use Log::Log4perl::Config::PropertyConfigurator;
my $user_conf = Log::Log4perl::Config::PropertyConfigurator->new();
$user_conf->file("s4:[bhumphreys.cube.exg.kosdaq]log.conf");
my $user_data = $user_conf->parse(); # will die() on error
print Dumper($user_data);
my $def_conf = Log::Log4perl::Config::PropertyConfigurator->new();
$def_conf->file("s4:[bhumphreys.cube_dev.lib]default_logger.conf");
my $defaults = $def_conf->parse(); # will die() on error
print Dumper($defaults);
Hash::Merge::set_behavior( 'LEFT_PRECEDENT' );
my %results = %{ merge( $user_data, $defaults ) };
print Dumper(\%results);
From:
Mike Schilli <m...@pe...>
To:
Ben Humphreys <bhu...@fa...>
Cc:
log...@li...
Date:
01/04/2009 01:41
Subject:
Re: [log4perl-devel] Multiple Config Files, or Default Behaviour
Workarounds?
On Tue, 31 Mar 2009, Ben Humphreys wrote:
> I want a default base set up for the logs, for formatting and levels
> of explicit-ness, but I also want users to be able to override certain
> parts of this behaviour with config files.
> I can imagine doing the default behaviour in Perl, and then loading the
> config file, but I'm not sure if that will trash all the default
settings.
> Or there is the string merge idea from the link above, but that seems a
> little tricky.
If you want to make sure that your settings have precedence, you need to
load the user configuration file first and then make the corrections.
The other way around, their configuration will override yours.
One way to 'merge' two configurations to use the parse() method of the
Log::Log4perl::Config::PropertyConfigurator class:
use Data::Dump qw(dump);
use Log::Log4perl::Config;
use Log::Log4perl::Config::PropertyConfigurator;
my $conf = Log::Log4perl::Config::PropertyConfigurator->new();
$conf->file("l4p.conf");
my $data = $conf->parse(); # will die() on error
print dump($data);
After that (and note that parse() will die() if there's an error, so you
might want to use an eval {} around it), $data will contain a data
structure that you then can modify and merge with another one obtained
from a second file.
Once you have a satisfactory data structure in $data, you can pass it as
the second (!) argument to Log4perl's init function:
Log::Log4perl->init( undef, $data );
Highly undocumented feature ;).
Hope that helps!
-- Mike
Mike Schilli
m...@pe...
|
|
From: Mike S. <m...@pe...> - 2009-03-31 16:41:33
|
On Tue, 31 Mar 2009, Ben Humphreys wrote:
> I want a default base set up for the logs, for formatting and levels
> of explicit-ness, but I also want users to be able to override certain
> parts of this behaviour with config files.
> I can imagine doing the default behaviour in Perl, and then loading the
> config file, but I'm not sure if that will trash all the default settings.
> Or there is the string merge idea from the link above, but that seems a
> little tricky.
If you want to make sure that your settings have precedence, you need to
load the user configuration file first and then make the corrections.
The other way around, their configuration will override yours.
One way to 'merge' two configurations to use the parse() method of the
Log::Log4perl::Config::PropertyConfigurator class:
use Data::Dump qw(dump);
use Log::Log4perl::Config;
use Log::Log4perl::Config::PropertyConfigurator;
my $conf = Log::Log4perl::Config::PropertyConfigurator->new();
$conf->file("l4p.conf");
my $data = $conf->parse(); # will die() on error
print dump($data);
After that (and note that parse() will die() if there's an error, so you
might want to use an eval {} around it), $data will contain a data
structure that you then can modify and merge with another one obtained
from a second file.
Once you have a satisfactory data structure in $data, you can pass it as
the second (!) argument to Log4perl's init function:
Log::Log4perl->init( undef, $data );
Highly undocumented feature ;).
Hope that helps!
-- Mike
Mike Schilli
m...@pe...
|
|
From: Ben H. <bhu...@fa...> - 2009-03-31 02:25:37
|
Apologies if this has been answered in more detail, but I couldn't find much beyond the following in the archives: http://www.mail-archive.com/log...@li.../msg00178.html I want a default base set up for the logs, for formatting and levels of explicit-ness, but I also want users to be able to override certain parts of this behaviour with config files. I can imagine doing the default behaviour in Perl, and then loading the config file, but I'm not sure if that will trash all the default settings. Or there is the string merge idea from the link above, but that seems a little tricky. How would it be best to do this? Thanks, Ben |
|
From: Mike S. <m...@pe...> - 2009-03-24 16:22:39
|
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...@pe...
> 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
>
|
|
From: Peter M. <pe...@ao...> - 2009-03-24 14:19:36
|
Hello,
I've encountered a problem with Log::Dispatch::FileRotate when running
multiple processes sharing the same log. 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
|
|
From: Ronald F. <yn...@mm...> - 2009-03-24 12:26:45
|
> > I'm creating loggers with easy_init (deliberately using no > > initialization file), and found that they are always created in > > 'clobber' mode. > > If you want "append", use ">>file": Of course, thank you! I stupidly overlooked it! Ronald -- Ronald Fischer <ro...@em...> + If a packet hits a pocket on a socket on a port, + and the bus is interrupted and the interrupt's not caught, + then the socket packet pocket has an error to report. + (cited after Peter van der Linden) |
|
From: Mike S. <m...@pe...> - 2009-03-23 17:26:30
|
On Mon, 23 Mar 2009, Ronald Fischer wrote: > I'm creating loggers with easy_init (deliberately using no > initialization file), and found that they are always created in > 'clobber' mode. If you want "append", use ">>file": "The "file" parameter takes file names preceded by ">" (overwrite) and ">>" (append) as arguments. This will cause "Log::Log4perl::Appender::File" appenders to be created behind the scenes." (perldoc Log::Log4perl) -- Mike Mike Schilli m...@pe... |
|
From: Mike S. <m...@pe...> - 2009-03-23 17:21:28
|
There's a gotcha: If you're using "STDOUT" as the 'file' parameter,
easy_init() creates a Screen appender, not a File appender -- hence you
can't call file_switch() on it.
I'd recommend using a standard l4p init file (or string) to define
exactly what kind of appender you want (File in this case).
-- Mike
Mike Schilli
m...@pe...
On Mon, 23 Mar 2009, Ronald Fischer wrote:
> I finally found the time to implement the solution for switching logfiles at run-time
> (see my posting "Re: Appender::File and Layout question" from March 6), but now
> I am facing a new problem: Perl (ActivePerl 5.8 on Windows) crashes when I try to
> switch the file.
>
> Here is the example code:
>
> Log::Log4perl->easy_init(
> {level => $log_level,
> file => 'STDOUT',
> layout => '%.1p %d{HH:mm} %M(%L) %m%n'
> },
> {level => $log_level,
> file => ">main.log",
> layout => '%.1p %d{dd.MM. HH:mm:ss (EEE)} %M(%L) %m%n'
> }
> {level => $log_level,
> file => '>dummy.log',
> layout => '%.1p %d{HH:mm} %M(%L) %m%n',
> name => 'requestlogger'
> },
> );
>
> ...
>
> # Switch 'requestlogger' to new file
> Log::Log4perl->appender_by_name('requestlogger')->file_switch('request_specific.log');
>
> At this point, Perl complains:
>
> "Can't call method "file_switch" on an undefined value"
>
> If I change the line so that it uses the default appender name,
>
> Log::Log4perl->appender_by_name('app002')->file_switch('request_specific.log');
>
> it works. It seems that easy_init does not use the "name" parameter. Is this a bug in easy_init,
> or is it supposed to work that way?
>
> Ronald
>
>
> --
> Ronald Fischer <ro...@em...>
> + If a packet hits a pocket on a socket on a port,
> + and the bus is interrupted and the interrupt's not caught,
> + then the socket packet pocket has an error to report.
> + (cited after Peter van der Linden)
>
>
> ------------------------------------------------------------------------------
> 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
> log...@li...
> https://lists.sourceforge.net/lists/listinfo/log4perl-devel
>
|
|
From: Ronald F. <yn...@mm...> - 2009-03-23 14:13:21
|
I'm creating loggers with easy_init (deliberately using no
initialization file), and found that they are always created in
'clobber' mode. After studying the code, I found I could change the mode
of a specific logger to 'clobber' using
Log::Log4perl->appender_by_name('app002')->{mode}='append';
This works, but it is a pretty bad solution, since I'm fiddling around
with the implementation of Log::Log4perl::Appender::File. Is there a
better way to set the mode? Just setting
mode => 'append'
in easy_init did not help.
Ronald
--
Ronald Fischer <ro...@em...>
+ If a packet hits a pocket on a socket on a port,
+ and the bus is interrupted and the interrupt's not caught,
+ then the socket packet pocket has an error to report.
+ (cited after Peter van der Linden)
|
|
From: Ronald F. <yn...@mm...> - 2009-03-23 12:10:01
|
I finally found the time to implement the solution for switching logfiles at run-time
(see my posting "Re: Appender::File and Layout question" from March 6), but now
I am facing a new problem: Perl (ActivePerl 5.8 on Windows) crashes when I try to
switch the file.
Here is the example code:
Log::Log4perl->easy_init(
{level => $log_level,
file => 'STDOUT',
layout => '%.1p %d{HH:mm} %M(%L) %m%n'
},
{level => $log_level,
file => ">main.log",
layout => '%.1p %d{dd.MM. HH:mm:ss (EEE)} %M(%L) %m%n'
}
{level => $log_level,
file => '>dummy.log',
layout => '%.1p %d{HH:mm} %M(%L) %m%n',
name => 'requestlogger'
},
);
...
# Switch 'requestlogger' to new file
Log::Log4perl->appender_by_name('requestlogger')->file_switch('request_specific.log');
At this point, Perl complains:
"Can't call method "file_switch" on an undefined value"
If I change the line so that it uses the default appender name,
Log::Log4perl->appender_by_name('app002')->file_switch('request_specific.log');
it works. It seems that easy_init does not use the "name" parameter. Is this a bug in easy_init,
or is it supposed to work that way?
Ronald
--
Ronald Fischer <ro...@em...>
+ If a packet hits a pocket on a socket on a port,
+ and the bus is interrupted and the interrupt's not caught,
+ then the socket packet pocket has an error to report.
+ (cited after Peter van der Linden)
|
|
From: Mike S. <m...@pe...> - 2009-03-20 16:47:57
|
On Fri, 20 Mar 2009, fo...@ne... wrote:
> - log4perl 1.10-1 (Ubuntu)
There's been a lot of changes to the Synchronized appender between
Log4perl 1.10 (released two years ago) and the current Log4perl 1.21 --
can you try the latest?
-- Mike
Mike Schilli
m...@pe...
>
> Configuration:
> Apache:
> PerlRequire /apache/startup.pl
> PerlWarn On
> PerlTaintCheck On
>
> Alias /action/ /apache/action/
> <Location /action/>
> SetHandler perl-script
> PerlResponseHandler ModPerl::Registry
> PerlOptions +ParseHeaders
> Options +ExecCGI
> Order allow,deny
> Allow from all
> </Location>
>
>
> Log4Perl:
> ...
> my $conf = qq(
> log4perl.category = $threshold, Syncer
>
> # File appender (unsynchronized)
> log4perl.appender.Logfile = Log::Log4perl::Appender::File
> log4perl.appender.Logfile.autoflush = 1
> log4perl.appender.Logfile.filename = $filename
> log4perl.appender.Logfile.mode = append
> log4perl.appender.Logfile.layout = Log::Log4perl::Layout::PatternLayout
> log4perl.appender.Logfile.layout.ConversionPattern = %d{dd/MMM/yyyy:HH:mm:ss} %p %m%n
>
> # Synchronizing appender, using the file appender above
> log4perl.appender.Syncer = Log::Log4perl::Appender::Synchronized
> log4perl.appender.Syncer.appender = Logfile
> log4perl.appender.Syncer.destroy = 1
> );
>
> Log::Log4perl::init( \$conf );
> my $logger = Log::Log4perl::get_logger();
> ...
>
>
> The threshold is set to INFO meaning that every call results in a single
> log entry being made. The script runs for about one second.
>
> When I tried out running the script as a handler (instead of the registry method), this did not
> change the behaviour.
>
> I understand that there are performance limits and eventually failures,
> but is not that a bit early, with only ten concurrent usersr?
>
> So I guess I have a misconfigured setup. Could anybody give me a good
> hint? I googled for my error, but without luck.
>
> Regs,
>
> Christian Folini
>
>
> --
> I myself am human and free only to the extent that I acknowledge the
> humanity and liberty of all my fellows...
> --- Mikhail Bakunin
>
> ------------------------------------------------------------------------------
> 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
> log...@li...
> https://lists.sourceforge.net/lists/listinfo/log4perl-devel
>
|
|
From: <fo...@ne...> - 2009-03-20 10:21:50
|
Hello,
I am running log4perl in a mod_perl2 script on an apache with worker
MPM.
Startig from 10 concurrent users, I am getting the following messages in
the error log.
[Fri Mar 20 10:37:28 2009] [error] [client 192.168.1.201] Couldn't set semaphore during object creation: Identifier removed at /usr/share/perl5/Log/Log4perl/Appender/Synchronized.pm line 45\n
More concurrent users means more of these errors.
The requests fail subsequently with http status 500.
Versions:
- Kernel: 2.6.22-14-generic
- Apache: 2.2.8 worker, self compiled
- log4perl 1.10-1 (Ubuntu)
Configuration:
Apache:
PerlRequire /apache/startup.pl
PerlWarn On
PerlTaintCheck On
Alias /action/ /apache/action/
<Location /action/>
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
Order allow,deny
Allow from all
</Location>
Log4Perl:
...
my $conf = qq(
log4perl.category = $threshold, Syncer
# File appender (unsynchronized)
log4perl.appender.Logfile = Log::Log4perl::Appender::File
log4perl.appender.Logfile.autoflush = 1
log4perl.appender.Logfile.filename = $filename
log4perl.appender.Logfile.mode = append
log4perl.appender.Logfile.layout = Log::Log4perl::Layout::PatternLayout
log4perl.appender.Logfile.layout.ConversionPattern = %d{dd/MMM/yyyy:HH:mm:ss} %p %m%n
# Synchronizing appender, using the file appender above
log4perl.appender.Syncer = Log::Log4perl::Appender::Synchronized
log4perl.appender.Syncer.appender = Logfile
log4perl.appender.Syncer.destroy = 1
);
Log::Log4perl::init( \$conf );
my $logger = Log::Log4perl::get_logger();
...
The threshold is set to INFO meaning that every call results in a single
log entry being made. The script runs for about one second.
When I tried out running the script as a handler (instead of the registry method), this did not
change the behaviour.
I understand that there are performance limits and eventually failures,
but is not that a bit early, with only ten concurrent usersr?
So I guess I have a misconfigured setup. Could anybody give me a good
hint? I googled for my error, but without luck.
Regs,
Christian Folini
--
I myself am human and free only to the extent that I acknowledge the
humanity and liberty of all my fellows...
--- Mikhail Bakunin
|
|
From: Mike S. <m...@pe...> - 2009-03-17 06:38:37
|
Hi Log4perl enthusiasts, the Log4perl 1.21 maintenance release was just pushed to the log4perl.com website, here's what's new: 1.21 (2009/03/16) * (ms) Documentation typos fixed, reported by Breno G. de Oliveira [rt.cpan.org #42428]. * (ms) Fixed DBI appender error message, bug reported by DavidZ. * (ms) Fixed [rt.cpan.org #43740] reported by Martin Koehler. Now using proper POSIX return code EEXISTS instead of error message depending on English locale. If all goes well, it'll hit CPAN in a couple of days. Enjoy! -- Mike Mike Schilli m...@pe... |
|
From: Mike S. <m...@pe...> - 2009-03-11 17:24:20
|
On Wed, 11 Mar 2009, DAY Roger wrote:
> That would work, cheers. I was thinking it'll be fun to write a custom
> appender.
No doubt, go for it :).
-- Mike
Mike Schilli
m...@pe...
>
> I'll think on it.
>
> Roger
>
>
> -----Original Message-----
> From: Mike Schilli [mailto:m...@pe...]
> Sent: 11 March 2009 15:41
> To: DAY Roger
> Cc: Mike Schilli; log4perl MailingList
> Subject: RE: [log4perl-devel] rotation on new run of script
>
> On Wed, 11 Mar 2009, DAY Roger wrote:
>
>> Which I take to mean it does do invocation-like rollovers. If this
>> doesn't work, I'll resort to a custom file appender.
>
> Actually, you could use something like this:
>
> log4perl.appender.Logfile = Log::Log4perl::Appender::File
> log4perl.appender.Logfile.filename = sub { "log-" . time() . ".log"
> }
>
> to name your logfiles after the current timestamp?
>
> -- Mike
>
> Mike Schilli
> m...@pe...
>
>>
>> I see what you mean about the valid date patterns. Implement in haste,
>> repent at leisure.
>>
>> Also, apologies for the stupid .sig. I have no control over it.
>>
>> Roger
>>
>> -----Original Message-----
>> From: Mike Schilli [mailto:m...@pe...]
>> Sent: 11 March 2009 07:37
>> To: DAY Roger
>> Cc: log4perl MailingList
>> Subject: Re: [log4perl-devel] rotation on new run of script
>>
>> On Tue, 10 Mar 2009, DAY Roger wrote:
>>
>>> Every time I run a script, I'd like my log-file to roll over. I
> invoke
>>> Log::Dispatch::FileRotate thusly
>>> ...
>>> DatePattern => 'HH-dd-yyyy',);
>>
>> Hmm, this is neither a valid date pattern (yyyy-MM-dd-HH would be
>> correct), according to the Log::Dispatch::FileRotate man page, nor
> does
>> it claim to roll it on every invocation.
>>
>> You probably need something like a custom file appender for this.
>>
>> -- Mike
>>
>> Mike Schilli
>> m...@pe...
>>
>> ****************************************************************
>> The operating companies affiliated with Atradius N.V. (Atradius Group)
> conduct insurance, debt collection and information services business
> through their registered (branch) offices in many countries. For
> information about the main registration details of Atradius Group
> offices in your country please visit
> http://global.atradius.com/general-content/legal/legallist.html
>>
>> IMPORTANT NOTICE. This e-mail, including any and all attachments, is
> intended for the addressee or its representative only. It is
> confidential and may be under legal privilege. Any form of unauthorised
> use, publication, reproduction, copying or disclosure of the content of
> this e-mail is not permitted. If you are not the intended recipient of
> this e-mail and its contents, please notify the sender immediately by
> reply e-mail and delete this e-mail and all its attachments
> subsequently.
>>
>> Although this e-mail and any attachments are believed to be free of
> any virus or other defect that might affect any computer system into
> which it is received and/or opened, it is the responsibility of the
> recipient to ensure that it is virus free and no responsibility is
> accepted by Atradius Group companies, either jointly or severally, for
> any loss or damage arising in any way from its use. E-mail received by
> Atradius Group can be stored for business purposes.
>> ****************************************
>>
>>
>>
>
|
|
From: DAY R. <Rog...@at...> - 2009-03-11 16:13:38
|
That would work, cheers. I was thinking it'll be fun to write a custom
appender.
I'll think on it.
Roger
-----Original Message-----
From: Mike Schilli [mailto:m...@pe...]
Sent: 11 March 2009 15:41
To: DAY Roger
Cc: Mike Schilli; log4perl MailingList
Subject: RE: [log4perl-devel] rotation on new run of script
On Wed, 11 Mar 2009, DAY Roger wrote:
> Which I take to mean it does do invocation-like rollovers. If this
> doesn't work, I'll resort to a custom file appender.
Actually, you could use something like this:
log4perl.appender.Logfile = Log::Log4perl::Appender::File
log4perl.appender.Logfile.filename = sub { "log-" . time() . ".log"
}
to name your logfiles after the current timestamp?
-- Mike
Mike Schilli
m...@pe...
>
> I see what you mean about the valid date patterns. Implement in haste,
> repent at leisure.
>
> Also, apologies for the stupid .sig. I have no control over it.
>
> Roger
>
> -----Original Message-----
> From: Mike Schilli [mailto:m...@pe...]
> Sent: 11 March 2009 07:37
> To: DAY Roger
> Cc: log4perl MailingList
> Subject: Re: [log4perl-devel] rotation on new run of script
>
> On Tue, 10 Mar 2009, DAY Roger wrote:
>
>> Every time I run a script, I'd like my log-file to roll over. I
invoke
>> Log::Dispatch::FileRotate thusly
>> ...
>> DatePattern => 'HH-dd-yyyy',);
>
> Hmm, this is neither a valid date pattern (yyyy-MM-dd-HH would be
> correct), according to the Log::Dispatch::FileRotate man page, nor
does
> it claim to roll it on every invocation.
>
> You probably need something like a custom file appender for this.
>
> -- Mike
>
> Mike Schilli
> m...@pe...
>
> ****************************************************************
> The operating companies affiliated with Atradius N.V. (Atradius Group)
conduct insurance, debt collection and information services business
through their registered (branch) offices in many countries. For
information about the main registration details of Atradius Group
offices in your country please visit
http://global.atradius.com/general-content/legal/legallist.html
>
> IMPORTANT NOTICE. This e-mail, including any and all attachments, is
intended for the addressee or its representative only. It is
confidential and may be under legal privilege. Any form of unauthorised
use, publication, reproduction, copying or disclosure of the content of
this e-mail is not permitted. If you are not the intended recipient of
this e-mail and its contents, please notify the sender immediately by
reply e-mail and delete this e-mail and all its attachments
subsequently.
>
> Although this e-mail and any attachments are believed to be free of
any virus or other defect that might affect any computer system into
which it is received and/or opened, it is the responsibility of the
recipient to ensure that it is virus free and no responsibility is
accepted by Atradius Group companies, either jointly or severally, for
any loss or damage arising in any way from its use. E-mail received by
Atradius Group can be stored for business purposes.
> ****************************************
>
>
>
|
|
From: Mike S. <m...@pe...> - 2009-03-11 15:41:04
|
On Wed, 11 Mar 2009, DAY Roger wrote:
> Which I take to mean it does do invocation-like rollovers. If this
> doesn't work, I'll resort to a custom file appender.
Actually, you could use something like this:
log4perl.appender.Logfile = Log::Log4perl::Appender::File
log4perl.appender.Logfile.filename = sub { "log-" . time() . ".log" }
to name your logfiles after the current timestamp?
-- Mike
Mike Schilli
m...@pe...
>
> I see what you mean about the valid date patterns. Implement in haste,
> repent at leisure.
>
> Also, apologies for the stupid .sig. I have no control over it.
>
> Roger
>
> -----Original Message-----
> From: Mike Schilli [mailto:m...@pe...]
> Sent: 11 March 2009 07:37
> To: DAY Roger
> Cc: log4perl MailingList
> Subject: Re: [log4perl-devel] rotation on new run of script
>
> On Tue, 10 Mar 2009, DAY Roger wrote:
>
>> Every time I run a script, I'd like my log-file to roll over. I invoke
>> Log::Dispatch::FileRotate thusly
>> ...
>> DatePattern => 'HH-dd-yyyy',);
>
> Hmm, this is neither a valid date pattern (yyyy-MM-dd-HH would be
> correct), according to the Log::Dispatch::FileRotate man page, nor does
> it claim to roll it on every invocation.
>
> You probably need something like a custom file appender for this.
>
> -- Mike
>
> Mike Schilli
> m...@pe...
>
> ****************************************************************
> The operating companies affiliated with Atradius N.V. (Atradius Group) conduct insurance, debt collection and information services business through their registered (branch) offices in many countries. For information about the main registration details of Atradius Group offices in your country please visit http://global.atradius.com/general-content/legal/legallist.html
>
> IMPORTANT NOTICE. This e-mail, including any and all attachments, is intended for the addressee or its representative only. It is confidential and may be under legal privilege. Any form of unauthorised use, publication, reproduction, copying or disclosure of the content of this e-mail is not permitted. If you are not the intended recipient of this e-mail and its contents, please notify the sender immediately by reply e-mail and delete this e-mail and all its attachments subsequently.
>
> Although this e-mail and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and/or opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by Atradius Group companies, either jointly or severally, for any loss or damage arising in any way from its use. E-mail received by Atradius Group can be stored for business purposes.
> ****************************************
>
>
>
|
|
From: DAY R. <Rog...@at...> - 2009-03-11 09:33:03
|
This from the web-page: "I initially aasumed a long runinng process but it seems people are using this module as part of short running CGI programs. So, now we look at the last modified time stamp of the log file and compare it to a previous occurance of a DatePattern, on startup only. If the file stat shows the mtime to be earlier than the previous recurrance then I rotate the log file." Which I take to mean it does do invocation-like rollovers. If this doesn't work, I'll resort to a custom file appender. I see what you mean about the valid date patterns. Implement in haste, repent at leisure. Also, apologies for the stupid .sig. I have no control over it. Roger -----Original Message----- From: Mike Schilli [mailto:m...@pe...] Sent: 11 March 2009 07:37 To: DAY Roger Cc: log4perl MailingList Subject: Re: [log4perl-devel] rotation on new run of script On Tue, 10 Mar 2009, DAY Roger wrote: > Every time I run a script, I'd like my log-file to roll over. I invoke > Log::Dispatch::FileRotate thusly >... > DatePattern => 'HH-dd-yyyy',); Hmm, this is neither a valid date pattern (yyyy-MM-dd-HH would be correct), according to the Log::Dispatch::FileRotate man page, nor does it claim to roll it on every invocation. You probably need something like a custom file appender for this. -- Mike Mike Schilli m...@pe... **************************************************************** The operating companies affiliated with Atradius N.V. (Atradius Group) conduct insurance, debt collection and information services business through their registered (branch) offices in many countries. For information about the main registration details of Atradius Group offices in your country please visit http://global.atradius.com/general-content/legal/legallist.html IMPORTANT NOTICE. This e-mail, including any and all attachments, is intended for the addressee or its representative only. It is confidential and may be under legal privilege. Any form of unauthorised use, publication, reproduction, copying or disclosure of the content of this e-mail is not permitted. If you are not the intended recipient of this e-mail and its contents, please notify the sender immediately by reply e-mail and delete this e-mail and all its attachments subsequently. Although this e-mail and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and/or opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by Atradius Group companies, either jointly or severally, for any loss or damage arising in any way from its use. E-mail received by Atradius Group can be stored for business purposes. **************************************** |
|
From: Mike S. <m...@pe...> - 2009-03-11 07:37:04
|
On Tue, 10 Mar 2009, DAY Roger wrote: > Every time I run a script, I'd like my log-file to roll over. I invoke > Log::Dispatch::FileRotate thusly >... > DatePattern => 'HH-dd-yyyy',); Hmm, this is neither a valid date pattern (yyyy-MM-dd-HH would be correct), according to the Log::Dispatch::FileRotate man page, nor does it claim to roll it on every invocation. You probably need something like a custom file appender for this. -- Mike Mike Schilli m...@pe... |
|
From: DAY R. <Rog...@at...> - 2009-03-10 17:34:49
|
Hi
Every time I run a script, I'd like my log-file to roll over. I invoke
Log::Dispatch::FileRotate thusly
my $file_appender =
Log::Log4perl::Appender>new("Log::Dispatch::FileRotate",
name => "Logfile",
mode => "append",
filename => $logfile,
TZ => 'GMT',
DatePattern => 'HH-dd-yyyy',);
But it doesn't seem to make a difference ... unless I've fallen into an
ActiveState hole again ...
Roger
****************************************************************
The operating companies affiliated with Atradius N.V. (Atradius Group) conduct insurance, debt collection and information services business through their registered (branch) offices in many countries. For information about the main registration details of Atradius Group offices in your country please visit http://global.atradius.com/general-content/legal/legallist.html
IMPORTANT NOTICE. This e-mail, including any and all attachments, is intended for the addressee or its representative only. It is confidential and may be under legal privilege. Any form of unauthorised use, publication, reproduction, copying or disclosure of the content of this e-mail is not permitted. If you are not the intended recipient of this e-mail and its contents, please notify the sender immediately by reply e-mail and delete this e-mail and all its attachments subsequently.
Although this e-mail and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and/or opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by Atradius Group companies, either jointly or severally, for any loss or damage arising in any way from its use. E-mail received by Atradius Group can be stored for business purposes.
****************************************
|