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: Viner, D. <dv...@ya...> - 2003-11-21 00:42:22
|
Hi, small note on the 0.40 release...the IPC::Shareable dependancy is not recorded in the Makefile.PL. Currently it reads: 'PREREQ_PM' => { Test::Simple => 0.43, Test::More => 0.45, File::Spec => 0.82, }, # e.g., Module::Name => 1.1 I think it needs to be 'PREREQ_PM' => { Test::Simple => 0.43, Test::More => 0.45, File::Spec => 0.82, IPC::Shareable => 0.60, }, # e.g., Module::Name => 1.1 dave -----Original Message----- From: Mike Schilli [mailto:msc...@ao...] Sent: Wednesday, November 12, 2003 3:00 PM To: log4perl-devel Subject: [log4perl-devel] 0.40 released Hi all, just released 0.40 to log4perl.sourceforge.net -- here's the changes: 0.40 (11/11/2003) * (ms) perl 5.005_03 fix for l4p::Appender::Synchronized * (ms) Fixed a bug in 0.39 (thanks to James King for finding) which caused composite appenders like Synchronized to just use SimpleLayout. With the fix, composite appenders are now relaying messages unmodified to their delegates, which can then apply any layout they desire. * (ms) Added file_open(), file_close() and file_switch() to l4p::Appender::File If all goes well, it'll be on its way to CPAN in a couple of days ... -- -- Mike Mike Schilli m...@pe... ------------------------------------------------------- This SF.Net email sponsored by: ApacheCon 2003, 16-19 November in Las Vegas. Learn firsthand the latest developments in Apache, PHP, Perl, XML, Java, MySQL, WebDAV, and more! http://www.apachecon.com/ _______________________________________________ log4perl-devel mailing list log...@li... https://lists.sourceforge.net/lists/listinfo/log4perl-devel |
From: Mike S. <msc...@ao...> - 2003-11-13 09:35:09
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> </head> <body> <font face=3D"Arial,sans-serif"><font size=3D"2"><span type=3D"cite">Dudi Goodman wrote on 11/13/2003, 1:21 AM:</span> </font></font> <p><font face=3D"Arial,sans-serif" size=3D"2"></font></p> <blockquote type=3D"cite" ><font face=3D"Arial,sans-serif" size=3D"2"></= font> <p class=3D"MsoNormal"><font face=3D"Arial,sans-serif" size=3D"2"><span =20= class=3D"EmailStyle15"><font size=3D"2" color=3D"black" face=3D"Arial"><span= arial=3D"">I have been trying too use the next line in my Log::Log4perl configuration file on windows XP :<o:p></o:p></span></font></span></font></p> <font face=3D"Arial,sans-serif" size=3D"2"></font> <p class=3D"MsoNormal"><font face=3D"Arial,sans-serif" size=3D"2"><span =20= class=3D"EmailStyle15"><font size=3D"2" color=3D"black" face=3D"Arial"><span= arial=3D"">log4perl.appender.A1=3DLog::Dispatch::FileRotate<o:p></o:p></s= pan></font></span></font></p> <font face=3D"Arial,sans-serif" size=3D"2"></font> <p class=3D"MsoNormal"><font face=3D"Arial,sans-serif" size=3D"2"><span =20= class=3D"EmailStyle15"><font size=3D"2" color=3D"black" face=3D"Arial"><span= arial=3D"">and it doesn=E2=80=99t work.</span></font></span></font></p> </blockquote> <font face=3D"Arial,sans-serif"><font size=3D"2">You didn't say what kind of error you're seeing ... could it be that Log::Dispatch::FileRotate isn't installed? Please post the exact error message and we'll be able to help you.<br> <br> <span>-- <br> -- Mike<br> Mike Schilli<br> <a class=3D"moz-txt-link-abbreviated" href=3D"mailto:m...@pe...">m@pe= rlmeister.com</a></span></font></font> </body> </html> |
From: Dudi G. <dgo...@fi...> - 2003-11-13 09:22:50
|
Hi there, I have been trying too use the next line in my Log::Log4perl = configuration file on windows XP : log4perl.appender.A1=3DLog::Dispatch::FileRotate and it doesn=92t work.=20 Is this problem familiar? Is there a way to solve it or an alternative = solution? =20 Thanks Dudi Goodman =20 |
From: Mike S. <msc...@ao...> - 2003-11-12 22:33:09
|
Hi all, just released 0.40 to log4perl.sourceforge.net -- here's the changes: 0.40 (11/11/2003) * (ms) perl 5.005_03 fix for l4p::Appender::Synchronized * (ms) Fixed a bug in 0.39 (thanks to James King for finding) which caused composite appenders like Synchronized to just use SimpleLayout. With the fix, composite appenders are now relaying messages unmodified to their delegates, which can then apply any layout they desire. * (ms) Added file_open(), file_close() and file_switch() to l4p::Appender::File If all goes well, it'll be on its way to CPAN in a couple of days ... -- -- Mike Mike Schilli m...@pe... |
From: Viner, D. <dv...@ya...> - 2003-11-11 23:54:27
|
Hi, I'm trying to understand what my options are if I want to have a multi-process app which logs all its messages via Log4perl to one log file. What are the common solutions to this situation? From digging around, it appears that I could use Dave Rolsky's Log::Dispatch::File::Locked to ensure that the log file is locked after opening it. Then, if that object is constructed with the 'close_after_write' flag, the dispatcher will close the file after writing it's message. I believe this means that in order to log a message, the dispatcher will (1) open the log file, (2) flock the log file, (3) log the message to the end of the file, (4) close the log file. [Note that step 2 might block until the process successfully obtains a lock on the log file. ] Does this sound correct? Thanks dave |
From: Alex M. <ale...@cl...> - 2003-10-30 08:54:16
|
On Wed, Oct 29, 2003 at 11:07:26PM -0800, Kevin Goess wrote: > | I see that MDC.pm has an undef value (which was recently '[undef]') > | but I don't see where it's changed to an empty string. By subclassing the > | place where undef values are changed to empty string, I could certainly > | get rid of my problem. > > It's changed in the sprintf() in PatternLayout::render(), since this: > > sprintf("%s", undef) > > produces the empty string, not undef. Thanks I'll have a look at it. I'll inform you of my research :) > | That's why it would be nice to provide a way for the users to do some > | kind of preprocessing on MDC values in order to handle problems which > | are specific to some kind of appenders. > > Tell me if I'm just being dense (which is more than likely), but is it > not true that you *do* have complete control the MDC values, you can > init the troublesome one via MDC->put('somenumeric',0) right next to > where you call Log4perl::init(), or even in a BEGIN{} block somewhere. > Right? Let me explain a bit the context. My application sends email. But it also does other things (like providing the user a web interface). I have a table where I insert informations about sent mail. When there is a problem while sending a mail, I log it in a file, but also in an error table, and I put in the error table the id of the failed mail. So, the integer column in the error table references primary keys of the sent mail table. As I said, error could happen when doing something else than sending a mail, so the integer column of my error table can hold NULL values. If I put a default value (0 for example) it could work if : - I remove the referecing integrity constraint or - I create a fake sent-mail which have an id of 0 and put if clauses everywhere in my code in order to not display information about this fake sent-mail Both of these solutions could work as quick workaround, but it's not clean. |
From: Kevin G. <ke...@go...> - 2003-10-30 07:09:49
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 | I see that MDC.pm has an undef value (which was recently '[undef]') | but I don't see where it's changed to an empty string. By subclassing the | place where undef values are changed to empty string, I could certainly | get rid of my problem. It's changed in the sprintf() in PatternLayout::render(), since this: sprintf("%s", undef) produces the empty string, not undef. | That's why it would be nice to provide a way for the users to do some | kind of preprocessing on MDC values in order to handle problems which | are specific to some kind of appenders. Tell me if I'm just being dense (which is more than likely), but is it not true that you *do* have complete control the MDC values, you can init the troublesome one via MDC->put('somenumeric',0) right next to where you call Log4perl::init(), or even in a BEGIN{} block somewhere. Right? What am I missing? Do you have another suggestion? I'm open to ideas.... - -- Happy Trails. . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510)525-5217 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) Comment: Using GnuPG with Netscape - http://enigmail.mozdev.org iD8DBQE/oLiu4g4/Tl71vUkRAqnNAJ4/ixvTH9XfA/W2hdbfvR44Vg6IxgCgmdC8 Bc4MC3qYUR2ViCUcXLHav1w= =+Xkz -----END PGP SIGNATURE----- |
From: Mike S. <msc...@ao...> - 2003-10-30 04:40:15
|
Simon Taylor wrote on 10/29/2003, 2:48 PM: > The logger resets the filename so I should get a new log for each job. I'm assuming by "job" you mean a call within the same (Unix) process -- correct? > The logger is then saved as part of the object Actually, loggers should *never* be saved in objects or elsewhere. You can always obtain them cheaply by calling get_logger("category"). This way, you're safe to change the configuration on the fly without ending up with stale loggers. > Log4PerlInit - is called from Config. > SelfLog is used when i want to get the Config module to log to the > same file as the module that called Log4PerlInit Not quite sure why you have two different functions -- there's a lot of code duplication between the two. Hopefully, you'll like the approach outlined further down. > Whats the best way to undef all the loggers at each job change. Or put > another way when running a long job how do I safely get log4perl to > switch to a new log appender and stop using the old one I won't suggest to call Log4perl's init() on every job, although that would probably work for your scenario. Unfortunately, our current file appender doesn't have a "switch_file" method. So, for now, you could create a new file appender class, inherit from L4p::Appender::File and define a switch_file method, blatently making use of L4p::Appender::File's private data: ################################################## package ReopeningFileAppender; ################################################## use warnings; use strict; use base qw(Log::Log4perl::Appender::File); ################################################## sub switch_file { ################################################## my($self, $newname) = @_; undef $self->{fh}; $self->{filename} = $newname; my $arrows = ">"; if($self->{mode} eq "append") { $arrows = ">>"; } my $fh = do { local *FH; *FH; }; open $fh, "$arrows$self->{filename}" or die "Can't open $self->{filename} ($@)"; $self->{fh} = $fh; } 1; __END__ If you put that code into ReopeningFileAppender.pm and define a configuration file l4p.conf like # l4p.conf log4perl.logger = DEBUG, APP1 log4perl.appender.APP1=ReopeningFileAppender log4perl.appender.APP1.layout = Log::Log4perl::Layout::SimpleLayout log4perl.appender.APP1.filename = test.log then your code is free to do something like Log::Log4perl->init("l4p.conf"); DEBUG("logged to test.log"); # Get appender and switch file on it my $app = Log::Log4perl::appenders()->{APP1}; $app->switch_file("foobar.log"); DEBUG("logged to foobar.log"); which first logs to test.log, then obtains the appender and causes it to flush its buffer to the old file and open a new one. Again, not pretty, because it assumes L4p::Appender::File isn't changing its private 'fh' handle, but for the next version, I might add a switch_file() method to our file appender. - -- Mike Mike Schilli m...@pe... |
From: Simon T. <se...@no...> - 2003-10-29 22:48:58
|
I am using log4perl in a system which does the following:- Iterates over a list of jobs it gets from a database Creates a CommandHandler which uses Log4Perl CommandHandler calls Config which uses Log4Perl Calls CommandIterator which uses Log4Perl I am defining a Log4Perl logger each time I change jobs in perl code. sub Log4PerlInit{ # Set up log4perl =head2 NAME Used to set up the Log4Perl logger Sets it up for the calling class - but also ensures that this class logs to it =cut my ($self, @args) = @_; my ($logfile, $logdir); # Just use the jobref id which will be a unique sequence to log into $logdir=$self->{LOG_DIR}.$args[0].$self->{U}.$self->LogTime; unless ( -e $logdir && -d $logdir){ mkpath($logdir) or throw TNBCriticalException("Cannot make directory $logdir"); } $logfile=$logdir.$self->{DLM}."job".$args[0].".log"; $self->{CurLogFile} = $logfile; # Jump off and define a logger for this class $self->{_logfile} = $self->SelfLog("DEBUG"); # Define a category logger for the calling class my $log = Log::Log4perl->get_logger($args[1]); # Define a layout my $layout = Log::Log4perl::Layout::PatternLayout->new("[%d][%p] %M %m%n"); # Define a file appender my $file_appender = Log::Log4perl::Appender->new( "Log::Log4perl::Appender::File", name => "filelog", filename => "$logfile"); # Define a stdout appender my $stdout_appender = Log::Log4perl::Appender->new( "Log::Log4perl::Appender::Screen", name => "screenlog", stderr => 0); $stdout_appender->layout($layout); $file_appender->layout($layout); $log->add_appender($stdout_appender); $log->add_appender($file_appender); $log->level($args[2]); return $logdir,$log; } sub SelfLog{ # Set up log4perl for this class =head2 NAME Used to set up the Log4Perl logger =cut my ($self, @args) = @_; # Jump off and define a logger for this class # Define a category logger for the calling class my $log = Log::Log4perl->get_logger("SDU::Config"); # Define a layout my $layout = Log::Log4perl::Layout::PatternLayout->new("[%d][%p] %M %m%n"); # Define a file appender my $file_appender = Log::Log4perl::Appender->new( "Log::Log4perl::Appender::File", name => "filelog", filename => $self->{CurLogFile}); # Define a stdout appender my $stdout_appender = Log::Log4perl::Appender->new( "Log::Log4perl::Appender::Screen", name => "screenlog", stderr => 0); # Have both appenders use the same layout (could be different) $stdout_appender->layout($layout); $file_appender->layout($layout); $log->add_appender($stdout_appender); $log->add_appender($file_appender); $log->level($INFO); return $log; } The logger resets the filename so I should get a new log for each job. The logger is then saved as part of the object Log4PerlInit - is called from Config. SelfLog is used when i want to get the Config module to log to the same file as the module that called Log4PerlInit Even though all my objects exist in CommandHandler and that is undefed at the end of the cycle. The Log4Perl loggers continue to point to the original logfile. Whats the best way to undef all the loggers at each job change. Or put another way when running a long job how do I safely get log4perl to switch to a new log appender and stop using the old one Simon Taylor Managed Services Technology Consultant Nortel Networks p - 01279 404289 (ESN 742 4289) m - 07740 533743 (ESN 748 3743) e - se...@no... "I code therefore I am" |
From: Alex M. <ale...@cl...> - 2003-10-29 17:39:46
|
On Wed, Oct 29, 2003 at 08:26:03AM -0800, Kevin Goess wrote: > >Well, your code produce the same error like mine. Maybe this is a matter > >of PostgreSQL version, what's yours ? Mine is 7.3.3. > > > >One can read this in 7.3 release notes : > > > > "An empty string ('') is no longer allowed as the input into an integer > > field. Formerly, it was silently interpreted as 0." > > Well, darn, mine is a venerable 7.1.3, nice find. If postgres is > requiring at least a 0 but only for numeric fields, not for all fields, > I don't see a way for the MDC stuff to have a 'conditional default' > value, it seems to me the solution is that you have to set the MDC value > to 0 as soon as you start up. What do you think? I think this not coherent to insert an empty string when we have an undefined value. An empty string is a defined value. That's an undef value which should be inserted (which is converted to NULL by DBI). I guess that will be a problem when printing to a log file because of warnings about undefined value. That's why it would be nice to provide a way for the users to do some kind of preprocessing on MDC values in order to handle problems which are specific to some kind of appenders. I see that MDC.pm has an undef value (which was recently '[undef]') but I don't see where it's changed to an empty string. By subclassing the place where undef values are changed to empty string, I could certainly get rid of my problem. -- Alex Marandon CLARISYS Informatique http://clarisys.fr |
From: Kevin G. <ke...@go...> - 2003-10-29 16:26:19
|
> Well, your code produce the same error like mine. Maybe this is a matter > of PostgreSQL version, what's yours ? Mine is 7.3.3. > > One can read this in 7.3 release notes : > > "An empty string ('') is no longer allowed as the input into an integer > field. Formerly, it was silently interpreted as 0." Well, darn, mine is a venerable 7.1.3, nice find. If postgres is requiring at least a 0 but only for numeric fields, not for all fields, I don't see a way for the MDC stuff to have a 'conditional default' value, it seems to me the solution is that you have to set the MDC value to 0 as soon as you start up. What do you think? -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: Alex M. <ale...@cl...> - 2003-10-29 09:46:37
|
On Tue, Oct 28, 2003 at 11:08:35PM -0800, Kevin Goess wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > |>it causes problems somewhere else, it's more consistent to just return > |>undef. Fixed and checked in ... > | > | But now it fails with the message : > | > | DBD::Pg::st execute failed: ERROR: pg_atoi: zero-length string at > | /usr/local/lib/perl5/site_perl/5.8.0/Log/Log4perl/Appender/DBI.pm line 96. > > Alex, sorry for the delay. I'm not reproducing your problem. The > following code runs fine, the two MDC columns end up with '' and 0 > respectively. Does it work for you? Can you send sample code that > produces your error? Hello, Well, your code produce the same error like mine. Maybe this is a matter of PostgreSQL version, what's yours ? Mine is 7.3.3. One can read this in 7.3 release notes : "An empty string ('') is no longer allowed as the input into an integer field. Formerly, it was silently interpreted as 0." http://www.postgresql.org/docs/7.3/interactive/release.html#AEN23568 -- Alex Marandon CLARISYS Informatique http://clarisys.fr |
From: Kevin G. <ke...@go...> - 2003-10-29 07:10:36
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 |>it causes problems somewhere else, it's more consistent to just return |>undef. Fixed and checked in ... | | But now it fails with the message : | | DBD::Pg::st execute failed: ERROR: pg_atoi: zero-length string at | /usr/local/lib/perl5/site_perl/5.8.0/Log/Log4perl/Appender/DBI.pm line 96. Alex, sorry for the delay. I'm not reproducing your problem. The following code runs fine, the two MDC columns end up with '' and 0 respectively. Does it work for you? Can you send sample code that produces your error? - ------------------------------------------------ use Log::Log4perl; use warnings; use strict; use DBI; my $pguser = 'postgres'; my $pwd = 'xxx'; my $dbh = DBI->connect('DBI:Pg:dbname=testdb',$pguser, $pwd, { RaiseError => 1, PrintError => 1 }); $dbh->do('DROP TABLE log4perltest'); my $stmt = <<EOL; ~ CREATE TABLE log4perltest ( ~ message char(128), ~ mdc_char char(16), ~ mdc_int int, ~ last_field char(1) ~ ) EOL $dbh->do($stmt); #creating a log statement where bind values 1,3,5 and 6 are #calculated from conversion specifiers and 2,4,7,8 are #calculated at runtime and fed to the $logger->whatever(...) #statement my $config = <<EOT; #log4j.category = WARN, DBAppndr, console log4j.category = WARN, DBAppndr log4j.appender.DBAppndr = Log::Log4perl::Appender::DBI log4j.appender.DBAppndr.datasource = DBI:Pg:dbname=testdb log4j.appender.DBAppndr.username = $pguser log4j.appender.DBAppndr.password = $pwd log4j.appender.DBAppndr.sql = \\ ~ insert into log4perltest \\ ~ (message, mdc_char, mdc_int,last_field) \\ ~ values (?,?,?,?) log4j.appender.DBAppndr.params.2 = %X{fubar} log4j.appender.DBAppndr.params.3 = %X{fubar} log4j.appender.DBAppndr.params.4 = x log4j.appender.DBAppndr.warp_message=0 #noop layout to pass it through log4j.appender.DBAppndr.layout = Log::Log4perl::Layout::NoopLayout EOT Log::Log4perl::init(\$config); #Log::Log4perl::MDC->put('fubar', 'xxx'); my $logger = Log::Log4perl->get_logger(); $logger->warn('warning message'); #xxx - -- - -- Happy Trails. . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510)525-5217 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) Comment: Using GnuPG with Netscape - http://enigmail.mozdev.org iD8DBQE/n2dy4g4/Tl71vUkRAtD3AJ9gYfx0NOJ5ZiJnzcMiyRWPi/zhLACdHglr mm3LaTcInZ8iNMxFhSt3qV0= =+EgU -----END PGP SIGNATURE----- |
From: Mike S. <msc...@ao...> - 2003-10-25 19:45:59
|
Jim Cromie wrote on 10/24/2003, 3:00 PM: > * an EasyUser.pm, which would use :easy logging and easy_init(), > * a StandardUser.pm, which would use the more explicit API > * an AutoCatUser.pm, which uses my module > > my test: t/09_coexist_easy.t uses 1,3 together in the same executable, As you've already mentioned, having all three of them active at once without preventing them from stepping on each other's toes could cause some hard-to-debug errors. However, what we'll have in one of the upcoming l4p releases is the notion of "logger repositories", separate compartments of l4p configurations, which work independently of each other within the same executable. Stay tuned ... -- -- Mike Mike Schilli m...@pe... |
From: Alex M. <ale...@cl...> - 2003-10-25 18:55:45
|
On Wed, Oct 22, 2003 at 11:18:50AM -0700, Mike Schilli wrote: > Kevin Goess wrote on 10/21/2003, 10:39 PM: > > > Do you remember the rationale for returning a string instead of just > > undef? Maybe we should at least make that configurable? What do you > > think? > > Think the rationale was that if the configuration file specifies a > layout with an MDC field and it's not defined in the code, > 'uninitialized variable' warnings are going to be all over the place. If > it causes problems somewhere else, it's more consistent to just return > undef. Fixed and checked in ... But now it fails with the message : DBD::Pg::st execute failed: ERROR: pg_atoi: zero-length string at /usr/local/lib/perl5/site_perl/5.8.0/Log/Log4perl/Appender/DBI.pm line 96. When I look at the query using DBI->trace(2), I see that it actually tries to insert a zero-length string instead of the expected NULL value. I've tried to figure out where the undef value is changed to a zero-length string in the code, but didn't success for now. -- Alex Marandon CLARISYS Informatique http://clarisys.fr |
From: Jim C. <jc...@di...> - 2003-10-24 23:22:26
|
Mike Schilli wrote: >Jim Cromie wrote on 10/23/2003, 5:41 AM: > > > But its not my usage per se, its a recommendation to users who > > would use AutoCategorize on some modules and not others. > > > > Telling them to use Log::Log4perl::Config->_init() > > *does* just work however, and I can live with that. > >Not sure I understand why one would need to 'add' configuration parts >instead of a complete reset&load. Feeding parts to the configuration >which are highly dependent on previously fed parts sounds error-prone to >me. What's the rationale? > > > The idea was to improve coexistence of both approaches in a larger application. It would seem possible that a project would have; * an EasyUser.pm, which would use :easy logging and easy_init(), * a StandardUser.pm, which would use the more explicit API * an AutoCatUser.pm, which uses my module my test: t/09_coexist_easy.t uses 1,3 together in the same executable, and they 'share' a single config, which contains whatever easy_init() put there, and my config, slapped in with it. That test now uses this code snippet, ie l4p::Config::_init, to avoid resetting easy_init()s config-initializations. use Log::Log4perl::AutoCategorize ( alias => 'myLogger', initfile => 'log-conf', # no effect here ); use Log::Log4perl qw(:easy); myLogger->easy_init ({ level => $INFO, file => "out.09_coexist_easy_easyout", layout => 'F=%F{1} M=%M L=%L: Cat=%c %m%n', }); # add initialization wo resetting Log::Log4perl::Config->_init('log-conf'); Im perfectly happy with this solution - and it implicitly flags the situation as less than ideal. As a project gets larger, they probably want to switch from Easy to Standard anyway - but Im not above luring them in with seductive appeal of Laziness :-D I agree that it would be easy to construct problematic configs this way, trashing earlier config by respesifying those items, and probably hard to debug. I will be adding some caveats to that effect in my upcoming 0.03 release. BTW - it was your feedback wrt interoperation/coexistence that started this ;-) thx again for a very cool module. |
From: Mike S. <msc...@ao...> - 2003-10-24 21:24:05
|
Jim Cromie wrote on 10/23/2003, 5:41 AM: > But its not my usage per se, its a recommendation to users who > would use AutoCategorize on some modules and not others. > > Telling them to use Log::Log4perl::Config->_init() > *does* just work however, and I can live with that. Not sure I understand why one would need to 'add' configuration parts instead of a complete reset&load. Feeding parts to the configuration which are highly dependent on previously fed parts sounds error-prone to me. What's the rationale? -- -- Mike Mike Schilli m...@pe... |
From: Jim C. <jc...@di...> - 2003-10-24 19:42:43
|
Mike Schilli wrote: >Jim Cromie wrote on 10/22/2003, 10:32 PM: > > > pls accept this patch to make pre 0.38 init available as initAdd. > > I need it to restore the ability of Log::Log4perl::AutoCategorize to > > play nice with others. > >+########################################### >+sub initAdd { >+########################################### >+ # make pre-0.38 init() behavior available for those who need it >+ return _init(@_); >+} > >Not sure why you're not using l4p:Config::_init() in l4p:AutoCategorize? >Does the underscore scare you :) ? > > > heh. that would work. But its not my usage per se, its a recommendation to users who would use AutoCategorize on some modules and not others. Telling them to use Log::Log4perl::Config->_init() *does* just work however, and I can live with that. |
From: Mike S. <msc...@ao...> - 2003-10-24 18:16:57
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> </head> <body> <font face=3D"Arial,sans-serif"><font size=3D"2"><span type=3D"cite">King, James X -ND wrote on 10/23/2003, 7:09 PM:</span> </font></font> <p><font face=3D"Arial,sans-serif" size=3D"2"></font></p> <blockquote type=3D"cite" ><font face=3D"Arial,sans-serif" size=3D"2"></= font> <p class=3D"MsoNormal"><font size=3D"2" face=3D"Arial"><span font-family= :arial=3D"">My cgi script dies at initializing. However, I can run the initialize within a program from the command line and it work. Has anyone seen this? I=E2=80=99m thinking it has something to do with running in cgi mode.<= /span></font></p> <font face=3D"Arial,sans-serif" size=3D"2"></font> <p class=3D"MsoNormal"><font size=3D"2" face=3D"Arial"><span font-family= :arial=3D""></span></font></p> </blockquote> <font face=3D"Arial,sans-serif"><font size=3D"2">Most likeley a permission problem with the logfile defined in the Log4perl config -- your webserver probably runs as "nobody" while the script runs under your user ID if you run it from the command line. To be sure, check your web server's error log file, it should display an appropriate error message coming from Log4perl's init().<br> <br> <span>-- <br> -- Mike<br> Mike Schilli<br> <a class=3D"moz-txt-link-abbreviated" href=3D"mailto:m...@pe...">m@pe= rlmeister.com</a></span></font></font> </body> </html> |
From: King, J. X -N. <Jam...@di...> - 2003-10-24 17:57:08
|
I'm running in a cgi environment and attempting to initialize my logger with the following commands (straight from the manual): =20 use Log::Log4perl; =20 Log::Log4perl->init($loggerFile); =20 My $loggerFile is my config file and contains the following: =20 log4perl.rootLogger=3DINFO, LOGFILE =20 # Set-up to append to the log file log4perl.appender.LOGFILE=3DLog::Log4perl::Appender::File log4perl.appender.LOGFILE.filename=3Dlogger.txt log4perl.appender.LOGFILE.mode=3Dappend =20 # Format of the message to be logged =20 =20 log4perl.appender.LOGFILE.layout=3DPatternLayout log4perl.appender.LOGFILE.layout.ConversionPattern=3D%d [%P] %p - %m%n =20 My cgi script dies at initializing. However, I can run the initialize within a program from the command line and it work. Has anyone seen this? I'm thinking it has something to do with running in cgi mode. Thanks, - James =20 James C. King Software Engineer email: Jam...@di... <mailto:Jam...@di...>=20 (818) 623-3594 =20 |
From: Mike S. <msc...@ao...> - 2003-10-24 06:05:10
|
Hi all, Log::Log4perl 0.39 is on its way to CPAN. Here's what's new: 0.39 (10/23/2003) * (kg) fixed bug in interaction between Logger::Level and Level::is_valid so that now you can do $logger->level('INFO') instead of just $INFO. * (ms) Added logic for 'composite appenders'. Appenders can now be configured to relay messages to other appenders. Added Log::Log4perl::Appender::Synchronized, an appender guaranteeing atomic logging of messages via semaphores. * (ms) Added basic substitution to PropertyConfigurator. Now you can define variables (like in "name=value") and subsequent patterns of "${name}" will be replaced by "value" in the configuration file. * (kg) Followed Mike's lead and added variable substitution to the DOMConfigurator. * (ms) Added Log::Log4perl::Appender::Socket as a simple Socket appender featuring connection recovery. -- -- Mike Mike Schilli m...@pe... |
From: Mike S. <msc...@ao...> - 2003-10-23 13:36:06
|
Jim Cromie wrote on 10/22/2003, 10:32 PM: > pls accept this patch to make pre 0.38 init available as initAdd. > I need it to restore the ability of Log::Log4perl::AutoCategorize to > play nice with others. +########################################### +sub initAdd { +########################################### + # make pre-0.38 init() behavior available for those who need it + return _init(@_); +} Not sure why you're not using l4p:Config::_init() in l4p:AutoCategorize? Does the underscore scare you :) ? -- -- Mike Mike Schilli m...@pe... |
From: Jim C. <jc...@di...> - 2003-10-23 05:39:52
|
hi folks, pls accept this patch to make pre 0.38 init available as initAdd. I need it to restore the ability of Log::Log4perl::AutoCategorize to play nice with others. Specifically, tests: 09_todo_coexist (not really todo anymore), and 10_multi_pack.t verify its ability to be used in part of a project, and to interoperate with other parts which are using the standard Log::Log4perl. If they make it in 0.39, Ill follow with an 0.03 Also: * I changed Changes to reflect that not only easy_init, but all its friends, do the reset. * I didnt document initAdd, cuz no mention was made of reset in main pod, so theres no good context to explain the difference. * initAdd creates one more way to alter a config at runtime. I dont think its a good way to do so repeatedly. In particular, I think mixing it and init-and-watch() would be a bad idea, unless youre *careful* to re-add config changes you made dynamically. * you may prefer expose only Log::Log4perl::Config::initAdd, not in main class, but that felt a bit too secret. FMITYWTK: # note the use time init, if you want it. use Log::Log4perl::AutoCategorize ( alias => 'myLogger', initfile => 'log-conf', # no effect here, cuz reset inside easy_init ); use Log::Log4perl qw(:easy); Log::Log4perl->easy_init ({ level => $INFO, file => "out.09_todo_coexist_easy", layout => 'F=%F{1} M=%M L=%L: Cat=%c %m%n', }); # in Log::Log4perl-0.38, easy_init now resets config, so we re-add it here Log::Log4perl->initAdd ('log-conf'); # these also work #Log::Log4perl::Config->initAdd ('log-conf'); #Log::Log4perl::AutoCategorize->initAdd ('log-conf'); |
From: King, J. X -N. <Jam...@di...> - 2003-10-23 04:21:33
|
I'm just wondering how the log4perl supports appendages to a log file if multiple CGI processes are running? In addition, how would the Dispathcer::FileRotate manage in a multiple process environment? =20 James C. King Software Engineer email: Jam...@di... <mailto:Jam...@di...>=20 (818) 623-3594 =20 |
From: Mike S. <msc...@ao...> - 2003-10-22 18:56:41
|
Kevin Goess wrote on 10/21/2003, 10:39 PM: > Do you remember the rationale for returning a string instead of just > undef? Maybe we should at least make that configurable? What do you > think? Think the rationale was that if the configuration file specifies a layout with an MDC field and it's not defined in the code, 'uninitialized variable' warnings are going to be all over the place. If it causes problems somewhere else, it's more consistent to just return undef. Fixed and checked in ... -- -- Mike Mike Schilli m...@pe... |