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: Mike S. <msc...@ao...> - 2002-11-14 02:51:29
|
Welcome to the recipe of the week. Today, let's talk about stealth loggers: What's the easiest way to use Log4perl? If you just want to get all the comfort of logging, without much overhead, use *Stealth Loggers*. If you use Log::Log4perl in ":easy" mode like use Log::Log4perl qw(:easy); you'll have the following functions available in the current package: DEBUG("message"); INFO("message"); WARN("message"); ERROR("message"); FATAL("message"); Just make sure that every package of your code where you're using them in pulls in "use Log::Log4perl qw(:easy)" first, then you're set. These stealth loggers will be absolutely silent until you initialize Log::Log4perl in your main program with either # Define any Log4perl behaviour Log::Log4perl->init("foo.conf"); (using a full-blown Log4perl config file) or the super-easy method # Just log to STDERR Log::Log4perl->easy_init($DEBUG); or the parameter-style method with a complexity somewhat in between: # Append to a log file Log::Log4perl->easy_init( { level => $DEBUG, file => ">>test.log" } ); For more info, please check out the "Stealth Loggers" section in the main Log::Log4perl documentation page. Have fun! -- -- Mike Mike Schilli log...@pe... http://log4perl.sourceforge.net |
From: Duncan C. <dca...@bc...> - 2002-11-12 13:41:11
|
Mike Schilli wrote: >> I have the beta of 5.8 from ActiveState running on my pc. When I run >> the Log4perl ppm install one liner I get this: >> >> C:\>ppm install "http://log4perl.sourceforge.net/ppm/Log-Log4perl.ppd" >> Error: no suitable installation target found for package Log-Log4perl. >> > I assume it needs to be updated for 5.8? Interesting. Do you know by any chance what could be causing it to > succeed on ActiveState 5.6.1 and fail on 5.8.0? Could this be a 5.8.0 > bug? Or a format change in PPD? I'll keep investigating ... I would guess it's the ARCHITECTURE element in the ppd file. That's where ppd files for 5.6 differ to 5.5. It looks as if you can change it to be "MSWin32-x86-multi-thread-5.8", see the following: http://www.geocrawler.com/lists/3/web/182/0/10120619/ Regards, Duncan Cameron |
From: <msc...@ao...> - 2002-11-12 06:44:58
|
Hi all, the latest maintenance release of Log::Log4perl, version 0.26, has been released to CPAN, featuring the following fixes: 0.26 10/28/2002 * (kg) enabled %l (was missing from PatternLayout::define) * (kg) got rid of "Use of uninitialized value in join or string" message when some of $logger->debug(@array) when some of @array are undef * (ms) Stealth loggers and documentation * (kg) Better error message for case reported by Hai Wu * (ms) Added Log/Log4perl/FAQ.pm, which the homepage links to * (ms) Took dependency on Test::More and Test::Simple out of the PPD file because of a problem with Activestate 5.6.1 reported by James Hahn <jr...@at...> * (ms) Added Log::Dispatch equivalent levels to the Log4perl loggers, which are passed on the Log::Dispatch appenders now according to the priority of the message instead of the default "DEBUG" setting * (ms) Added %P process ID to PatternLayout as suggested by Paul Harrington <Pau...@de...>. Also added %H as hostname * (kg) Added %min.max formatter to PatternLayout * (ms) Updated docs for Log::Log4perl::DateFormat Have fun! -- Mike ############################ # Mike Schilli # # log...@pe... # # http://perlmeister.com # # log4perl.sourceforge.net # ############################ |
From: Mike S. <msc...@ao...> - 2002-11-11 23:52:35
|
Bob H wrote: > I have the beta of 5.8 from ActiveState running on my pc. When I run > the Log4perl ppm install one liner I get this: > > C:\>ppm install "http://log4perl.sourceforge.net/ppm/Log-Log4perl.ppd" > Error: no suitable installation target found for package Log-Log4perl. > I assume it needs to be updated for 5.8? Interesting. Do you know by any chance what could be causing it to succeed on ActiveState 5.6.1 and fail on 5.8.0? Could this be a 5.8.0 bug? Or a format change in PPD? I'll keep investigating ... > > BTW...Log4perl is really cool! Thanks :) -- -- Mike Mike Schilli log...@pe... |
From: Bob H <bo...@ad...> - 2002-11-11 19:31:35
|
I have the beta of 5.8 from ActiveState running on my pc. When I run the Log4perl ppm install one liner I get this: C:\>ppm install "http://log4perl.sourceforge.net/ppm/Log-Log4perl.ppd" Error: no suitable installation target found for package Log-Log4perl. I assume it needs to be updated for 5.8? BTW...Log4perl is really cool! Bob |
From: Kevin G. <ke...@go...> - 2002-11-11 17:50:45
|
I tracked it down into Sys::Syslog, the xlate() sub has a truth/defined problem, returning eval { &$name } || -1; where EMERG returns 0, which is correct but false. I verified on comp.lang.perl* (Google) that this is a problem with perl 5.6.1 (fixed in 5.8.0): http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=rt-18190-40904.16.0654694398814%40bugs6.perl.org&rnum=7&prev=/groups%3Fq%3DSys::Syslog%2BEMERG%26hl%3Den%26lr%3D%26ie%3DUTF-8%26selm%3Drt-18190-40904.16.0654694398814%2540bugs6.perl.org%26rnum%3D7 here is their fix to Sys/Syslog.pm: # Can't have just eval { &$name } || -1 #because some LOG_XXX may be zero. my $value = eval { &$name }; defined $value ? $value : -1; So we (log4perl) are ok, and our tests will pass as long as we don't log to FATAL. Our unit tests probably shouldn't log to FATAL anyway, since that translates to EMERG and might have other consequences, like bothering the boxes' sysadmin. Interestingly enough, there doesn't seem to be a patch to fix Sys::Syslog short of upgrading to perl 5.8.0. msc...@ao... wrote: > In a message dated 11/8/2002 12:26:32 PM Eastern Standard Time, ke...@go... writes: > > >>Interesting, I get mostly failures and some success >> FreeBSD 4.4 ok >> RedHat 7.0 fail >> RedHat 7.1 fail >> RedHat 7.2 fail > > > Weird. Just tried it on my RH7.1 Linux box at home and got the correct result again: > > 1..5 > ok 1 > ok 2 > ok 3 > ok 4 > ok 5 > $ > Message from syslogd@michael at Fri Nov 8 21:37:29 2002 ... > michael ./syslog.pl: FATAL - foo > > > What's also weird is that the error message you're seeing points to line 78 in Log::Dispatch::Syslog, which reads > > Sys::Syslog::closelog; > > and shouldn't print any errors. Have you found out anything else? > -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: <msc...@ao...> - 2002-11-09 19:15:21
|
Interesting proposal of the log4j folks, to use %words instead of the one-letter parameters (attached) ... -- -- Mike |
From: <msc...@ao...> - 2002-11-09 06:35:28
|
In a message dated 11/8/2002 12:34:05 PM Eastern Standard Time, ke...@go... writes: >What do you think? Once I feel a consensus I need to add error >checking, unit tests, and maybe some documentation. If subclassing hurts performance, it's probably not the right way to go. Also, it might be difficult to subclass PatternLayout. Adding it to PatternLayout should be fine. One more thought: Is adding Perl code to the conf file the right approach or should this be a perl API along the same lines as Eric's create_custom_level() which has to be called before init()? Typical placeholders probably don't need to be changed as often as the log4perl configuration, but might be more system-specific. Something like a class method as in Log::Log4perl::Layout::PatternLayout->extend("%K", sub {...}) perhaps? Just a thought ... -- -- Mike ############################ # Mike Schilli # # log...@pe... # # http://perlmeister.com # # log4perl.sourceforge.net # ############################ |
From: <msc...@ao...> - 2002-11-09 05:42:23
|
In a message dated 11/8/2002 12:26:32 PM Eastern Standard Time, ke...@go... writes: >Interesting, I get mostly failures and some success > FreeBSD 4.4 ok > RedHat 7.0 fail > RedHat 7.1 fail > RedHat 7.2 fail Weird. Just tried it on my RH7.1 Linux box at home and got the correct result again: 1..5 ok 1 ok 2 ok 3 ok 4 ok 5 $ Message from syslogd@michael at Fri Nov 8 21:37:29 2002 ... michael ./syslog.pl: FATAL - foo What's also weird is that the error message you're seeing points to line 78 in Log::Dispatch::Syslog, which reads Sys::Syslog::closelog; and shouldn't print any errors. Have you found out anything else? -- -- Mike ############################ # Mike Schilli # # log...@pe... # # http://perlmeister.com # # log4perl.sourceforge.net # ############################ |
From: Kevin G. <ke...@go...> - 2002-11-08 17:34:14
|
>> And even better, check this out, how about user-assigned format >> specifiers at runtime in the config file? (The diff doesn't work as a >> patch, dunno why, but you can apply the .rej by hand) > > Way cool! It deviates from the log4j spec, but it's a handy feature. > Question is if we should put it into PatternLayout.pm or create a subclass? I don't know. If we're deviating from their spec it seems like we should subclass it. On the other hand, it's pretty obvious from the perl code in the config file that there's perl-specific stuff going on, and subclassing would hurt performance. I'd say, if we're already breaking compatibility with %P and %H, this isn't any worse than that. What do you think? Once I feel a consensus I need to add error checking, unit tests, and maybe some documentation. -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: Kevin G. <ke...@go...> - 2002-11-08 17:26:43
|
>> with the syslog appender it gives this error message for the >> ->fatal() level (the other levels work fine). >> >> syslog: invalid level/facility: EMERG at >> /usr/local/lib/perl5/site_perl/5.6.1/Log/Dispatch/Syslog.pm line 78 >> >> Is this a known problem with Log::Dispatch::Syslog, or what? >> > Thanks for the test case. Funny, it works perfectly here on my Linux box > -- 5 cases, no errors, all I get is a message on the console from the > syslog daemon, but that's expected behaviour I guess. I'm using perl > 5.8.0 on RH7.2 with Log::Dispatch::Syslog 1.18. Interesting, I get mostly failures and some success FreeBSD 4.4 ok RedHat 7.0 fail RedHat 7.1 fail RedHat 7.2 fail Requires more investigation. -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: Kevin G. <ke...@go...> - 2002-11-08 16:54:19
|
Checked in, with tests. Mike Schilli wrote: > ke...@go... wrote: > >> While we're on the subbject of PatternLayout, is there any reason >> we're not including precision (aka max field width) in the sprintf >> format specifiers? We can do >> %20m >> but not >> %20.20m >> >> and the change is below, shall I put it in? >> > Great idea, sure! > -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: Kevin G. <ke...@go...> - 2002-11-08 16:46:03
|
> Regarding %P and %H, I'll go ahead and submit those to the log4j guys, > maybe they'll like it, too. I wouldn't count on it. Remember, Java in its quest to be "platform independent" won't implement anything it can't do universally. There is no built-in way to get a pid from inside the JVM, I had to write JNI code to do it. I'll bet the same is true for hostname, even the perl module resorts to hackery Sys::Hostname - Try every conceivable way to get hostname and croaks if nothing works. -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: Mike S. <msc...@ao...> - 2002-11-08 02:40:35
|
ke...@go... wrote: > One of the java projects I used log4j in really wanted a pid too, boy > was that a hassle. I agree, let's putin %P and %H. > > And even better, check this out, how about user-assigned format > specifiers at runtime in the config file? (The diff doesn't work as a > patch, dunno why, but you can apply the .rej by hand) Way cool! It deviates from the log4j spec, but it's a handy feature. Question is if we should put it into PatternLayout.pm or create a subclass? Regarding %P and %H, I'll go ahead and submit those to the log4j guys, maybe they'll like it, too. -- -- Mike Mike Schilli log...@pe... |
From: Mike S. <msc...@ao...> - 2002-11-08 01:51:22
|
ke...@go... wrote: > Excellent solution. I had started one yesterday myself but yours is > way better. > > But check out the attached test. Without the syslog appender it works > fine, but with the syslog appender it gives this error message for the > ->fatal() level (the other levels work fine). > > syslog: invalid level/facility: EMERG at > /usr/local/lib/perl5/site_perl/5.6.1/Log/Dispatch/Syslog.pm line 78 > > Is this a known problem with Log::Dispatch::Syslog, or what? > Thanks for the test case. Funny, it works perfectly here on my Linux box -- 5 cases, no errors, all I get is a message on the console from the syslog daemon, but that's expected behaviour I guess. I'm using perl 5.8.0 on RH7.2 with Log::Dispatch::Syslog 1.18. -- -- Mike Mike Schilli log...@so... |
From: Mike S. <msc...@ao...> - 2002-11-07 21:33:26
|
ke...@go... wrote: > While we're on the subbject of PatternLayout, is there any reason > we're not including precision (aka max field width) in the sprintf > format specifiers? We can do > %20m > but not > %20.20m > > and the change is below, shall I put it in? > Great idea, sure! -- -- Mike Mike Schilli log...@pe... |
From: Mike S. <msc...@ao...> - 2002-11-07 20:05:16
|
Pau...@de... wrote: >Here is the full patch .... put in the extra (but not necessary?) step of >assigning to $result just to highlight it. > Thanks, that's exactly how I checked it into CVS last night -- with the exception of the last snippet (in the foreach loop over stack entries), I don't think that's needed. Or is it? -- -- Mike Mike Schilli log...@pe... |
From: Kevin G. <ke...@go...> - 2002-11-07 18:21:47
|
While we're on the subbject of PatternLayout, is there any reason we're not including precision (aka max field width) in the sprintf format specifiers? We can do %20m but not %20.20m It's supported in log4j (http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout.html) and the change is below, shall I put it in? --- old/PatternLayout.pm Thu Nov 7 10:13:11 2002 +++ lib/Log/Log4perl/Layout/PatternLayout.pm Thu Nov 7 10:10:33 2002 @@ -89,7 +89,7 @@ } # Parse the format - $format =~ s/%(-*\d*) + $format =~ s/%(-?\d*(?:\.\d+)?) ([cCdfFIlLmMnprtxX%]) (?:{(.*?)})*/ rep($self, $1, $2, $3); -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: Kevin G. <ke...@go...> - 2002-11-07 17:37:46
|
One of the java projects I used log4j in really wanted a pid too, boy was that a hassle. I agree, let's putin %P and %H. And even better, check this out, how about user-assigned format specifiers at runtime in the config file? (The diff doesn't work as a patch, dunno why, but you can apply the .rej by hand) Aaron Straup Cope wrote: > FWIW, I would cast a vote for /H/i too. > > This, and 'P', were both widgets that we included in our own home-brewed > log thingy. > > On Thu, 7 Nov 2002, Harrington, Paul wrote: > > >>Here is the full patch .... put in the extra (but not necessary?) step of >>assigning to $result just to highlight it. >> >>I don't know how you guys feel about 'feeping creaturism' with tokens but we >>would also like a token, say %h or %H, for the hostname ... we use are using >>a centralized file for our logs so would like the hostname too. > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: See the NEW Palm > Tungsten T handheld. Power & Color in a compact size! > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: Kevin G. <ke...@go...> - 2002-11-07 16:58:53
|
Excellent solution. I had started one yesterday myself but yours is way better. But check out the attached test. Without the syslog appender it works fine, but with the syslog appender it gives this error message for the ->fatal() level (the other levels work fine). syslog: invalid level/facility: EMERG at /usr/local/lib/perl5/site_perl/5.6.1/Log/Dispatch/Syslog.pm line 78 Is this a known problem with Log::Dispatch::Syslog, or what? Mike Schilli wrote: > Hi there, > > here's a patch to review for the problem of Log4perl passing along messages to the Log::Dispatch > appenders with priority DEBUG only. > > What I did was define a mapping between Log4perl priorities/levels and Log::Dispatch's, put it into > a hash (%L4P_TO_LD) in Log::Log4perl::Levels and extend the level-generating function with one > additional parameter, which is the equivalent Log::Dispatch priority of the Log4perl priority to be > defined. This way, all Log::Dispatch appenders are initialized with min_level=debug (no change), but > the loggers will figure out at runtime (hash-lookup) what Log::Dispatch priority corresponds to the > current message's level and pass that on the Log::Dispatch logger when it comes down to actually > logging the message. > I've defined a test case also, but it doesn't show up yet, because I haven't checked in the file > yet. It's getting kind of late, so let me submit this to the list before I check it in, just to make > sure I haven't overlooked anything stupid :) > > -- Mike > -------------------------------------------------------- > Mike Schilli log...@pe... http://perlmeister.com > -------------------------------------------------------- > > > ------------------------------------------------------------------------ > > ? t/030LDLevel.t > Index: lib/Log/Log4perl/Appender.pm > =================================================================== > RCS file: /cvsroot/log4perl/Log-Log4perl/lib/Log/Log4perl/Appender.pm,v > retrieving revision 1.14 > diff -a -u -r1.14 Appender.pm > --- lib/Log/Log4perl/Appender.pm 23 Oct 2002 20:19:45 -0000 1.14 > +++ lib/Log/Log4perl/Appender.pm 7 Nov 2002 09:51:36 -0000 > @@ -60,8 +60,10 @@ > } > > my $appender = $appenderclass->new( > - # Set min_level to default, *we* are controlling this now > - min_level => 'debug', > + # Set min_level to the lowest setting. *we* are > + # controlling this now, the appender should just > + # log it with no questions asked. > + min_level => 'debug', > # Set 'name' and other parameters > map { $_ => $params{$_} } keys %params, > ); > Index: lib/Log/Log4perl/Level.pm > =================================================================== > RCS file: /cvsroot/log4perl/Log-Log4perl/lib/Log/Log4perl/Level.pm,v > retrieving revision 1.10 > diff -a -u -r1.10 Level.pm > --- lib/Log/Log4perl/Level.pm 18 Sep 2002 04:33:28 -0000 1.10 > +++ lib/Log/Log4perl/Level.pm 7 Nov 2002 09:51:37 -0000 > @@ -24,24 +24,44 @@ > our %PRIORITY = (); # unless (%PRIORITY); > our %LEVELS = () unless (%LEVELS); > our %SYSLOG = () unless (%SYSLOG); > +our %L4P_TO_LD = () unless (%L4P_TO_LD); > > sub add_priority { > - my ($prio, $intval, $syslog) = @_; > + my ($prio, $intval, $syslog, $log_dispatch_level) = @_; > $prio = uc($prio); # just in case; > > - $PRIORITY{$prio} = $intval; > - $LEVELS{$intval} = $prio; > - $SYSLOG{$prio} = $syslog if defined($syslog); > + $PRIORITY{$prio} = $intval; > + $LEVELS{$intval} = $prio; > + > + # Set up the mapping between Log4perl integer levels and > + # Log::Dispatch levels > + # Note: Log::Dispatch uses the following levels: > + # 0 debug > + # 1 info > + # 2 notice > + # 3 warning > + # 4 error > + # 5 critical > + # 6 alert > + # 7 emergency > + > + # The equivalent Log::Dispatch level is optional, set it to > + # the highest value (7=emerg) if it's not provided. > + $log_dispatch_level = 7 unless defined $log_dispatch_level; > + > + $L4P_TO_LD{$prio} = $log_dispatch_level; > + > + $SYSLOG{$prio} = $syslog if defined($syslog); > } > > # create the basic priorities > -add_priority("OFF", OFF_INT, -1); > -add_priority("FATAL", FATAL_INT, 0); > -add_priority("ERROR", ERROR_INT, 3); > -add_priority("WARN", WARN_INT, 4); > -add_priority("INFO", INFO_INT, 6); > -add_priority("DEBUG", DEBUG_INT, 7); > -add_priority("ALL", ALL_INT, 7); > +add_priority("OFF", OFF_INT, -1, 7); > +add_priority("FATAL", FATAL_INT, 0, 7); > +add_priority("ERROR", ERROR_INT, 3, 4); > +add_priority("WARN", WARN_INT, 4, 3); > +add_priority("INFO", INFO_INT, 6, 1); > +add_priority("DEBUG", DEBUG_INT, 7, 0); > +add_priority("ALL", ALL_INT, 7, 0); > > # we often sort numerically, so a helper func for readability > sub numerically {$a <=> $b} > Index: lib/Log/Log4perl/Logger.pm > =================================================================== > RCS file: /cvsroot/log4perl/Log-Log4perl/lib/Log/Log4perl/Logger.pm,v > retrieving revision 1.36 > diff -a -u -r1.36 Logger.pm > --- lib/Log/Log4perl/Logger.pm 15 Oct 2002 23:17:48 -0000 1.36 > +++ lib/Log/Log4perl/Logger.pm 7 Nov 2002 09:51:39 -0000 > @@ -205,7 +205,7 @@ > \$appender->log( > #these get passed through to Log::Dispatch > { name => \$appender_name, > - level => 0, > + level => \$Log::Log4perl::Level::L4P_TO_LD{\$level}, > message => \$message, > }, > #these we need > Index: lib/Log/Log4perl/TestBuffer.pm > =================================================================== > RCS file: /cvsroot/log4perl/Log-Log4perl/lib/Log/Log4perl/TestBuffer.pm,v > retrieving revision 1.5 > diff -a -u -r1.5 TestBuffer.pm > --- lib/Log/Log4perl/TestBuffer.pm 23 Sep 2002 16:45:43 -0000 1.5 > +++ lib/Log/Log4perl/TestBuffer.pm 7 Nov 2002 09:51:39 -0000 > @@ -10,7 +10,8 @@ > use base qw( Log::Dispatch::Output ); > use fields qw( stderr ); > > -our %POPULATION = (); > +our %POPULATION = (); > +our $LOG_PRIORITY = 0; > > ################################################## > sub new { > @@ -36,6 +37,7 @@ > my $self = shift; > my %params = @_; > > + $self->{buffer} .= "[$params{level}]: " if $LOG_PRIORITY; > $self->{buffer} .= $params{message}; > } > -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: Aaron S. C. <as...@vi...> - 2002-11-07 16:12:55
|
FWIW, I would cast a vote for /H/i too. This, and 'P', were both widgets that we included in our own home-brewed log thingy. On Thu, 7 Nov 2002, Harrington, Paul wrote: > Here is the full patch .... put in the extra (but not necessary?) step of > assigning to $result just to highlight it. > > I don't know how you guys feel about 'feeping creaturism' with tokens but we > would also like a token, say %h or %H, for the hostname ... we use are using > a centralized file for our logs so would like the hostname too. |
From: Harrington, P. <Pau...@de...> - 2002-11-07 16:02:28
|
Here is the full patch .... put in the extra (but not necessary?) step of assigning to $result just to highlight it. I don't know how you guys feel about 'feeping creaturism' with tokens but we would also like a token, say %h or %H, for the hostname ... we use are using a centralized file for our logs so would like the hostname too. pjjH --- PatternLayout.pm Mon Oct 7 17:41:50 2002 +++ /proj/finop/local_boffice/lib/perl5/site_perl/5.6.1/Log/Log4perl/Layout/Patt ernLayout.pm Wed Nov 6 14:47:25 2002 @@ -90,7 +90,7 @@ # Parse the format $format =~ s/%(-*\d*) - ([cCdfFILmMnprtxX%]) + ([cCdfFILmMnpPrtxX%]) (?:{(.*?)})*/ rep($self, $1, $2, $3); /gex; @@ -171,6 +171,7 @@ $info{d} = 1; # Dummy value, corrected later $info{n} = "\n"; $info{p} = $priority; + $info{P} = $$; if($self->{info_needed}->{r}) { if($TIME_HIRES_AVAILABLE) { @@ -201,6 +202,9 @@ # just for %d if($op eq 'd') { $result = $info{$op}->format(current_time()); + } + if($op eq 'P') { + $result = $$; } } push @results, $result; -----Original Message----- From: msc...@ao... [mailto:msc...@ao...] Sent: Thursday, November 07, 2002 5:49 AM To: Harrington, Paul; log...@li... Subject: Re: [log4perl-devel] Could we have a token in PatternLayout for pid In a message dated 11/6/2002 6:26:36 PM Eastern Standard Time, Pau...@de... writes: >we hacked in support today for a %P token so that we can include process ids >in the log messages without mucking around with the application-level log >messages. Accepted and checked in -- it's going to be part of 0.26, thanks! -- -- Mike ############################ # Mike Schilli # # log...@pe... # # http://perlmeister.com # # log4perl.sourceforge.net # ############################ |
From: <msc...@ao...> - 2002-11-07 10:48:53
|
In a message dated 11/6/2002 6:26:36 PM Eastern Standard Time, Pau...@de... writes: >we hacked in support today for a %P token so that we can include process ids >in the log messages without mucking around with the application-level log >messages. Accepted and checked in -- it's going to be part of 0.26, thanks! -- -- Mike ############################ # Mike Schilli # # log...@pe... # # http://perlmeister.com # # log4perl.sourceforge.net # ############################ |
From: <msc...@ao...> - 2002-11-07 10:47:45
|
In a message dated 11/6/2002 6:26:36 PM Eastern Standard Time, Pau...@de... writes: >we hacked in support today for a %P token so that we can include process ids >in the log messages without mucking around with the application-level log >messages. I think Kevin suggested the same thing a while ago, so I went ahead and checked it in, along with a test case. It's going to be part of the upcoming 0.26 release. Thanks for your proposal, think it's going to be useful for many people! -- -- Mike ############################ # Mike Schilli # # log...@pe... # # http://perlmeister.com # # log4perl.sourceforge.net # ############################ |
From: Mike S. <m...@pe...> - 2002-11-07 09:57:29
|
Hi there, here's a patch to review for the problem of Log4perl passing along messages to the Log::Dispatch appenders with priority DEBUG only. What I did was define a mapping between Log4perl priorities/levels and Log::Dispatch's, put it into a hash (%L4P_TO_LD) in Log::Log4perl::Levels and extend the level-generating function with one additional parameter, which is the equivalent Log::Dispatch priority of the Log4perl priority to be defined. This way, all Log::Dispatch appenders are initialized with min_level=debug (no change), but the loggers will figure out at runtime (hash-lookup) what Log::Dispatch priority corresponds to the current message's level and pass that on the Log::Dispatch logger when it comes down to actually logging the message. I've defined a test case also, but it doesn't show up yet, because I haven't checked in the file yet. It's getting kind of late, so let me submit this to the list before I check it in, just to make sure I haven't overlooked anything stupid :) -- Mike -------------------------------------------------------- Mike Schilli log...@pe... http://perlmeister.com -------------------------------------------------------- |