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: John O. <joh...@o-...> - 2007-02-23 21:22:10
|
Hi Martin, I can't help but I'll be watching for answers because I'm seeing a possibly related problem when using FileRotate initialised from a config file called by Apache. I have a mod_perl app which is loaded during Apache startup (while Apache is root) which calls init_and_watch. If I have my FileRotate log going at startup, only the server startup messages get written because the child processes run as 'apache' which doesn't have permission to write to the file create by Apache while it was root. As a workaround I have it commented out in my log4perl config on startup then I un-comment it and init_and_watch catches the change and starts writing. Obviously there are a few solutions but I've yet to choose a 'neat' solution. John Martin Evans wrote: > Hi, > > I've been using Log::Log4perl for ages now in a set of CPAN modules we > wrote and internally in a project here. All has been ok, it works well - > thank you. > > This issue is mostly related to Log::Dispatch::FileRotate|File but I am > posting here since I may need advice on an alternative. > > Our log files are getting pretty large and after seeing a post on this > list I decided to try Log::Dispatch::FileRotate. It seemed to work fine > at first. The logging is in a single module, this module is used in > multiple places/processes under different uids and we have a single > config file. One of the places is code running under modperl, the other > is a daemon in perl. > > The first problem was due to umasks and first to start (the daemon or > modperl) created the file and the other couldn't open it. I tried > > log4perl.appender.X1.umask = sub { 0000 } > > but it would seem Log::Dispatch::FileRotate does not know umask. I then > discovered "permissions" so did: > > log4perl.appender.X1.permissions = sub { 0666 } > > and this appears to work until another uid comes along in which case you > get: > > Cannot chmod /tmp/dbix.log to 438: Operation not permitted at > /usr/lib/perl5/site_perl/5.8.8/Log/Dispatch/File.pm line 96 > > I don't get this as Log::Dispatch::File says: > > "If the file does not already exist, the permissions that it should be > created with." > > so I presume this is a bug. > > Am I wasting my time here? Would I be better going back to > Log::Log4perl::Appender::File, using ".umask" and some external file > rotator? Any recommendations? > > Martin > |
From: Mike S. <m...@pe...> - 2007-02-23 21:16:04
|
On Fri, 23 Feb 2007, Martin Evans wrote: > I've been using Log::Log4perl for ages now in a set of CPAN modules we > wrote and internally in a project here. All has been ok, it works well - > thank you. Excellent, thanks for sharing! > but it would seem Log::Dispatch::FileRotate does not know umask. That's a feature that I think needs to be added to Log::Dispatch::FileRotate, similar to what Log::Log4perl::Appender::File does. FileRotate's author has been known to read this mailing list, so maybe it'll come soon :). That being said, there's situations where processes are running as different users, and all of them are writing to the same logfile. To avoid permission problems in this scenario (think about what happens when one user triggers the rotation), I've found it easiest to use an external rotator instead. Log::Logperl supports this as well: http://log4perl.sourceforge.net/d/Log/Log4perl/FAQ.html#2d0d0 -- Mike Mike Schilli m...@pe... > I then > discovered "permissions" so did: > > log4perl.appender.X1.permissions = sub { 0666 } > > and this appears to work until another uid comes along in which case you > get: > > Cannot chmod /tmp/dbix.log to 438: Operation not permitted at > /usr/lib/perl5/site_perl/5.8.8/Log/Dispatch/File.pm line 96 > > I don't get this as Log::Dispatch::File says: > > "If the file does not already exist, the permissions that it should be > created with." > > so I presume this is a bug. > > Am I wasting my time here? Would I be better going back to > Log::Log4perl::Appender::File, using ".umask" and some external file > rotator? Any recommendations? > > Martin > -- > Martin J. Evans > Easysoft Limited > http://www.easysoft.com > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |
From: Martin E. <mar...@ea...> - 2007-02-23 16:16:19
|
I forgot to say when I used "permissions" to set 0666 with Log::Dispatch::FileRotate I only ssaw the log output from the first process. Martin -- Martin J. Evans Easysoft Limited http://www.easysoft.com Martin Evans wrote: > Hi, > > I've been using Log::Log4perl for ages now in a set of CPAN modules we > wrote and internally in a project here. All has been ok, it works well - > thank you. > > This issue is mostly related to Log::Dispatch::FileRotate|File but I am > posting here since I may need advice on an alternative. > > Our log files are getting pretty large and after seeing a post on this > list I decided to try Log::Dispatch::FileRotate. It seemed to work fine > at first. The logging is in a single module, this module is used in > multiple places/processes under different uids and we have a single > config file. One of the places is code running under modperl, the other > is a daemon in perl. > > The first problem was due to umasks and first to start (the daemon or > modperl) created the file and the other couldn't open it. I tried > > log4perl.appender.X1.umask = sub { 0000 } > > but it would seem Log::Dispatch::FileRotate does not know umask. I then > discovered "permissions" so did: > > log4perl.appender.X1.permissions = sub { 0666 } > > and this appears to work until another uid comes along in which case you > get: > > Cannot chmod /tmp/dbix.log to 438: Operation not permitted at > /usr/lib/perl5/site_perl/5.8.8/Log/Dispatch/File.pm line 96 > > I don't get this as Log::Dispatch::File says: > > "If the file does not already exist, the permissions that it should be > created with." > > so I presume this is a bug. > > Am I wasting my time here? Would I be better going back to > Log::Log4perl::Appender::File, using ".umask" and some external file > rotator? Any recommendations? > > Martin |
From: Martin E. <mar...@ea...> - 2007-02-23 16:03:34
|
Hi, I've been using Log::Log4perl for ages now in a set of CPAN modules we wrote and internally in a project here. All has been ok, it works well - thank you. This issue is mostly related to Log::Dispatch::FileRotate|File but I am posting here since I may need advice on an alternative. Our log files are getting pretty large and after seeing a post on this list I decided to try Log::Dispatch::FileRotate. It seemed to work fine at first. The logging is in a single module, this module is used in multiple places/processes under different uids and we have a single config file. One of the places is code running under modperl, the other is a daemon in perl. The first problem was due to umasks and first to start (the daemon or modperl) created the file and the other couldn't open it. I tried log4perl.appender.X1.umask = sub { 0000 } but it would seem Log::Dispatch::FileRotate does not know umask. I then discovered "permissions" so did: log4perl.appender.X1.permissions = sub { 0666 } and this appears to work until another uid comes along in which case you get: Cannot chmod /tmp/dbix.log to 438: Operation not permitted at /usr/lib/perl5/site_perl/5.8.8/Log/Dispatch/File.pm line 96 I don't get this as Log::Dispatch::File says: "If the file does not already exist, the permissions that it should be created with." so I presume this is a bug. Am I wasting my time here? Would I be better going back to Log::Log4perl::Appender::File, using ".umask" and some external file rotator? Any recommendations? Martin -- Martin J. Evans Easysoft Limited http://www.easysoft.com |
From: Mike S. <m...@pe...> - 2007-02-17 00:16:48
|
On Sat, 17 Feb 2007, Saw, Kelvin wrote: > Is there anyway that I just want to log certain info into certain file > using log4perl > I want to log all error messages into daily_error.log and all info > message into daily_info.log > > but once I logging at the coding side, the error msg and info msg are > logged to each files; daily_error.log and daily_info.log This FAQ explains it: http://log4perl.sourceforge.net/d/Log/Log4perl/FAQ.html#c7fa8 -- Mike Mike Schilli m...@pe... |
From: Robert J. <yad...@sn...> - 2007-02-15 21:09:58
|
At 03:06 PM 2/15/2007, John ORourke wrote: >It has this nifty feature built in, no need to write more code - see below.... >[snip] > > >From my log4perl.conf file: > >log4perl.logger.DataSite = DEBUG, DebugLog >log4perl.appender.DebugLog = Log::Dispatch::FileRotate >log4perl.appender.DebugLog.min_level=debug >log4perl.appender.DebugLog.max=10 >log4perl.appender.DebugLog.DatePattern=yyyy-MM-dd >log4perl.appender.DebugLog.TZ=UTC >log4perl.appender.DebugLog.filename=/tmp/debug_log >log4perl.appender.DebugLog.mode=append >log4perl.appender.DebugLog.layout=PatternLayout >log4perl.appender.DebugLog.layout.ConversionPattern =[%d] [%P] %M(%p) - %m%n > > > >The bit you want is DatePattern - it sets the pattern for the >rotated files - in your case: > >DatePattern=yyyyMMdd > >When the evaluated version of that changes, it will do the rename >and start a new file. Are you sure? The documentation for the module says this: "We don't use DatePattern to define the extension of the log file though." The DatePattern seems to define *when to rotate*, and does not affect the file extension. Are you saying you have FileRotate working so that it renames using the DatePattern? Neither the docs nor the code (which I posted earlier) seem to support that... Rob |
From: John O. <joh...@o-...> - 2007-02-15 20:05:43
|
It has this nifty feature built in, no need to write more code - see below.... Robert Jacobson wrote: > At 07:53 AM 2/15/2007, Dirk Vleugels wrote: > >> Hi, >> >> is there a easy way to give the rotated files a different suffix? >> Currently a rotated file will be named: >> >> example.log -> example.log.1 >> >> but i need something like: >> >> example.log.YYYYMMDDHH >> >> Maybe by defining a callback? I can't find anything in the docs ... >> > > Therefore, you need to subclass and override the log_message() method in order to get the name change you want. Do you know how to do that? I'm not an expert, but I've done something similar before with other modules. > From my log4perl.conf file: log4perl.logger.DataSite = DEBUG, DebugLog log4perl.appender.DebugLog = Log::Dispatch::FileRotate log4perl.appender.DebugLog.min_level=debug log4perl.appender.DebugLog.max=10 log4perl.appender.DebugLog.DatePattern=yyyy-MM-dd log4perl.appender.DebugLog.TZ=UTC log4perl.appender.DebugLog.filename=/tmp/debug_log log4perl.appender.DebugLog.mode=append log4perl.appender.DebugLog.layout=PatternLayout log4perl.appender.DebugLog.layout.ConversionPattern =[%d] [%P] %M(%p) - %m%n The bit you want is DatePattern - it sets the pattern for the rotated files - in your case: DatePattern=yyyyMMdd When the evaluated version of that changes, it will do the rename and start a new file. cheers John |
From: Robert J. <yad...@sn...> - 2007-02-15 19:55:16
|
At 07:53 AM 2/15/2007, Dirk Vleugels wrote: >Hi, > >is there a easy way to give the rotated files a different suffix? >Currently a rotated file will be named: > >example.log -> example.log.1 > >but i need something like: > >example.log.YYYYMMDDHH > >Maybe by defining a callback? I can't find anything in the docs ... Well, Log::Dispatch::FileRotate isn't part of Log::Log4perl, but I can answer anyway :) I took a look at the source code for FileRotate.pm -- and the renaming scheme is hard-coded: sub log_message { #[...] while($idx >= 0) { if($idx <= 0) { warn "$$ rename $name $name.1\n" if $self->{debug}; rename($name, "$name.1"); } else { warn "$$ rename $name.$idx $name.".($idx+1)."\n" if $self->{debug}; rename("$name.$idx", "$name.".($idx+1)); } $idx--; } # [...] Therefore, you need to subclass and override the log_message() method in order to get the name change you want. Do you know how to do that? I'm not an expert, but I've done something similar before with other modules. HTH, Rob -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Robert Jacobson .......................... Flight Ops. Team Solar Dynamics Observatory (SDO) ............. .............. |
From: Dirk V. <dir...@gm...> - 2007-02-15 12:53:45
|
Hi, is there a easy way to give the rotated files a different suffix? Currently a rotated file will be named: example.log -> example.log.1 but i need something like: example.log.YYYYMMDDHH Maybe by defining a callback? I can't find anything in the docs ... Cheers, Dirk |
From: Mike S. <m...@pe...> - 2007-02-08 07:05:42
|
Hi Log4perl folks, just released the Log::Log4perl 1.09 maintenance release to the website. Here's what's changed: 1.09 (2007/02/07) * (ms) Added $^S check to FAQ, as suggested by J. David Blackstone. * (ms) Applied Robert Jacobson's patch for the "DDD" formatter in L4p::DateFormats, which now formats the day-of-year values numerically and precedes them with zeroes if necessary. * (ms) Added %M{x} PatternLayout notation as requested by Ankur Gupta. * (ms) Another Win32 test suite fix, no longer deleting an open file but moving it aside (rt.cpan:23520). If all goes well, it'll hit CPAN in a couple of days. Enjoy! -- Mike Mike Schilli m...@pe... |
From: Mike S. <m...@pe...> - 2007-02-07 22:04:20
|
On Thu, 8 Feb 2007, Ankur Gupta wrote: > My pattern layout is like this. > %-5p | %-4L | %-10c{1} | %-20M - %m%n > > but I would prefer > > %-5p | %-4L | %-10c{1} | %-20M{1} - %m%n Makes sense, I'll put it in 1.09. -- Mike Mike Schilli m...@pe... > > DEBUG | 851 | Module | method_name - Value is abcd > > So can we have the curlies for %M similar to %c. > > Log/Log4perl/Layout/PatternLayout.pm > @@ -293,8 +293,6 @@ > > if($ops eq "c") { > $data = shrink_category($data, $curlies); > - } elsif($ops eq "M") { > - $data = shrink_category($data, $curlies); > } elsif($ops eq "C") { > $data = shrink_category($data, $curlies); > } elsif($ops eq "X") { > > --Ankur > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier. > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |
From: Ankur G. <ank...@gm...> - 2007-02-07 18:34:14
|
Hi, My pattern layout is like this. %-5p | %-4L | %-10c{1} | %-20M - %m%n The modules names are quite lengthy. So the log becomes too messy to read. For eg. DEBUG | 851 | Module | Very::Long::Name::Module::method_name - Value is abcd but I would prefer %-5p | %-4L | %-10c{1} | %-20M{1} - %m%n DEBUG | 851 | Module | method_name - Value is abcd So can we have the curlies for %M similar to %c. Log/Log4perl/Layout/PatternLayout.pm @@ -293,8 +293,6 @@ if($ops eq "c") { $data = shrink_category($data, $curlies); - } elsif($ops eq "M") { - $data = shrink_category($data, $curlies); } elsif($ops eq "C") { $data = shrink_category($data, $curlies); } elsif($ops eq "X") { --Ankur |
From: Eric W. <scr...@gm...> - 2007-01-29 07:08:45
|
# from Mike Schilli # on Sunday 28 January 2007 07:30 pm: >On Fri, 26 Jan 2007, Eric Wilhelm wrote: >> The issue is that the code never gets compiled. The @INC hook >> sets[1] $INC{"foo/bar.pm"}, so any subsequent require()'s don't try >> to load it. The errors will be equivalent to something like: >> >> mkdir -p foo/Time >> echo "1;" > foo/Time/HiRes.pm >> perl -Ifoo -e 'use Time::HiRes'; Sorry, that last line should have read perl -Ifoo -e 'use Log::Log4perl' Which should get you a huge pile of errors starting with: Undefined subroutine &Time::HiRes::gettimeofday called at /usr/.../Log/Log4perl/Layout/PatternLayout.pm line 34. Of course, nothing would work in this circumstance, but exactly the same thing is happening with your module_available() call in the presence of an @INC hook. >> Because the @INC hook only returns a filehandle, to fully >> re-implement require (which I don't suggest), you must >> eval("$string") the contents of that. > >Can you send some perl code that shows the problem? I still don't > understand what the problem is, especially where the @INC hook comes > from. Please see the attached demo. The @INC hook in par is basically _find_par_internals(), which you can read here: http://search.cpan.org/src/SMUELLER/PAR-0.972/lib/PAR.pm If you're still not seeing what's wrong with calling those coderefs and not eval($string)'ing the result, please read 'perldoc -f require' again. "Note that these hooks are also permitted to set the %INC entry corresponding to the files they have loaded." >> My question is: why not eval {require Foo} ? >Try this: > $SIG{__DIE__} = sub { print STDERR "Die! What?\n"; exit 0 }; I can understand the concern, but if that is the only reason, then I have to say it is bad trade-off to break a documented perl feature to allow for improper usage of a discouraged one. That is a poorly written die hook which didn't follow the documentation. See perlfunc/die. Any well-behaved SIG{__DIE__} should have: die @_ if $^S; # get out if we're in an eval Though, you could always put local $SIG{__DIE__} in the eval if you're feeling lenient. If you rework module_available() to use eval, that would be a good place for it. Note, the attached (academic) example will demonstrate the issue. Calling it with no arguments means the first call to the hook is from module_available(), with a command-line argument, we'll require Sys::Hostname ourselves and module_available() will be happy. Also attached is a patch which implements my proposed fix. As I said, you could check whether $@ =~ /Can't locate $mod_path/, but that's only if you think compilation errors should be propagated (hint: put another curly around the "local $SIG{DIE}; eval {...}" chunk before you throw an error so it propagates correctly.) Hopefully, the break_log4perl.pl attachment can be easily adapted to your test suite. Please let me know if there's anything else I can do to help get this fixed. Thanks, Eric -- "Left to themselves, things tend to go from bad to worse." --Murphy's Corollary --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- |
From: Mike S. <m...@pe...> - 2007-01-26 06:15:04
|
On Tue, 23 Jan 2007, Eric Wilhelm wrote: > I've run into a bug in Log::Log4perl::Util::module_available when > running in a par environment. This may be an issue with PAR, but I > have to guess that most @INC subroutine hooks are not expecting to be > called directly. Hi Eric, to work around issues with PAR, this FAQ shows a couple of tricks: http://log4perl.sourceforge.net/releases/Log-Log4perl/docs/html/Log/Log4perl/FAQ.html#9ea64 > The problem comes up in Log::Log4perl::Layout::PatternLayout (though I'm > sure it could happen elsewhere in different circumstances.) Basically, > the module_available call returning true upsets the delicate balance of > things (I'm guessing because the @INC hook sets an entry in %INC, which > stops any further requires from actually loading the code.) > > if(Log::Log4perl::Util::module_available("Sys::Hostname")) { > require Sys::Hostname; > $HOSTNAME = Sys::Hostname::hostname(); > } > > I'm wondering if there's some reason that cannot simply be an eval > { require Sys::Hostname}, (possibly checking that the error is m/^Can't > locate Sys\/Hostname\.pm/ rather than some compile error.) Not quite sure I understand the problem ... what's the error message you're getting? -- Mike Mike Schilli m...@pe... > > Thanks, > Eric > -- > "Insert random misquote here" > --------------------------------------------------- > http://scratchcomputing.com > --------------------------------------------------- > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |
From: Mike S. <m...@pe...> - 2007-01-26 00:45:38
|
Check out an advance chapter on logging with Log4perl of brian d foy's upcoming book "Mastering Perl": http://www252.pair.com/comdog/mastering_perl/Chapters/13.logging.html -- Mike Mike Schilli m...@pe... |
From: Eric W. <scr...@gm...> - 2007-01-24 01:29:13
|
Hi (sorry, I'm not on the list, please cc replies) I've run into a bug in Log::Log4perl::Util::module_available when running in a par environment. This may be an issue with PAR, but I have to guess that most @INC subroutine hooks are not expecting to be called directly. The problem comes up in Log::Log4perl::Layout::PatternLayout (though I'm sure it could happen elsewhere in different circumstances.) Basically, the module_available call returning true upsets the delicate balance of things (I'm guessing because the @INC hook sets an entry in %INC, which stops any further requires from actually loading the code.) if(Log::Log4perl::Util::module_available("Sys::Hostname")) { require Sys::Hostname; $HOSTNAME = Sys::Hostname::hostname(); } I'm wondering if there's some reason that cannot simply be an eval { require Sys::Hostname}, (possibly checking that the error is m/^Can't locate Sys\/Hostname\.pm/ rather than some compile error.) Thanks, Eric -- "Insert random misquote here" --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- |
From: John O. <jo...@ve...> - 2007-01-22 08:01:40
|
Mike Schilli wrote: Thanks for the logger/category tip, the documentation didn't mention it but used both. > > BTW, L4p uses dots instead of colons in class names when they're > part of configuration definitions, like > > log4perl.logger.My.Module=... > Yeah I gather it supports both from the documentation, it says they're equivalent ( http://log4perl.sourceforge.net/releases/Log-Log4perl/docs/html/Log/Log4perl.html ). While I'm here... I patched Log::Dispatch::ApacheLog so it doesn't need to be passed an Apache object, allowing it to be put in the config file - I'll try and put together a Log::Log4perl::Appender using it, anyone interested? cheers John |
From: Mike S. <m...@pe...> - 2007-01-22 00:54:35
|
On Sat, 20 Jan 2007, John ORourke wrote: > In a config file what's the difference between: > > log4perl.logger.My::Module=... > and > log4perl.category.My::Module=... The keywords "logger" and "category" are synonymous. BTW, L4p uses dots instead of colons in class names when they're part of configuration definitions, like log4perl.logger.My.Module=... -- Mike Mike Schilli m...@pe... > > ? > > cheers > John > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |
From: John O. <joh...@o-...> - 2007-01-20 15:11:35
|
Hi folks, In a config file what's the difference between: log4perl.logger.My::Module=... and log4perl.category.My::Module=... ? cheers John |
From: Robert J. <yad...@sn...> - 2007-01-12 18:46:24
|
At 12:58 PM 1/12/2007, Mike Schilli m-at-perlmeister.com |log4perl_sourceforge| wrote: >Not sure if I understand correctly, but if you want to know how your >custom appender was used in the L4p configuration file, and specifically >what name has been assigned to it: That's ambiguous, because a certain >type of appender could be used multiple times under different names. That's what I mean exactly. But it seems like maybe I don't need it. I was building my own hash, like %params = ( name => $name, level => 2, log4p_level => 'INFO', message => 'Log message', log4p_category => $category, ); then calling SUPER::log(%params). I thought I couldn't build that hash without $name and $category -- thus the original question. Then I figured I'll just try it without them --and it still works even if "name" isn't the name of a real appender. I guess name and category only need to be correct if you are using them in the layout? (I didn't try it with "incorrect" name and category while having them in the layout...) >But you can always get all used appenders names by calling > > my $appenders = Log::Log4perl->appenders(); Thanks, I saw that -- it lists the appenders, but I don't know which one is currently being called. -- Rob |
From: Mike S. <m...@pe...> - 2007-01-12 17:58:50
|
On Thu, 11 Jan 2007, Robert Jacobson wrote: > I'm writing my own appender. How does one get the appender's own > name, outside of the > log() method? i.e, for this conf: > > log4perl.appender.Database = Log::Log4perl::Appender::DBI > > The appender's name is "Database". Not sure if I understand correctly, but if you want to know how your custom appender was used in the L4p configuration file, and specifically what name has been assigned to it: That's ambiguous, because a certain type of appender could be used multiple times under different names. But you can always get all used appenders names by calling my $appenders = Log::Log4perl->appenders(); which returns a reference to a hash mapping all appender names to their appender objects. See the following man sections for details: http://log4perl.sourceforge.net/d/Log-Log4perl/docs/html/Log/Log4perl.html#356d5 http://log4perl.sourceforge.net/d/Log/Log4perl/FAQ.html#92664 -- Mike Mike Schilli m...@pe... |
From: Robert J. <yad...@sn...> - 2007-01-11 19:09:25
|
Hi, I'm writing my own appender. How does one get the appender's own name, outside of the log() method? i.e, for this conf: log4perl.appender.Database = Log::Log4perl::Appender::DBI The appender's name is "Database". Thanks, Rob |
From: Robert J. <yad...@sn...> - 2007-01-08 14:50:48
|
I'm having a problem adding new configuration items to my subclass -- is it possible without copying the code from Appender::DBI::new() to add a new configuration item? The code I tried (below) didn't work -- the new option "LOGBUFFER" did not appear because the %defaults hash in DBI.pm is basically throwing it away. I would basically like to use the existing new() method in Appender::DBI, so I'm calling SUPER::new() in my subclass. -----BEGIN subclass DBI_Buffer package DBI_Buffer; use base ("Log::Log4perl::Appender::DBI"); use strict; use warnings; sub new { my ($class, %options) = @_; my $self = { LOGBUFFER => 2000, %options, }; bless $self, $class; return $self->SUPER::new(%options); } -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Robert Jacobson .......................... Flight Ops. Team Solar Dynamics Observatory (SDO) ............. .............. |
From: Robert J. <yad...@sn...> - 2007-01-08 13:39:55
|
At 01:50 AM 1/8/2007, Mike Schilli wrote: >By the way, you might want to take a look at mysql_auto_reconnect >[snip] wouldn't this solve your problem? Perhaps it would. I have to find out what happens when mysql_auto_reconnect is turned on, but the actual database or network connection is truly down. Turning on reconnects within Appender::DBI caused my perl programs to block while waiting for the reconnection -- defeating the purpose of the queuing mechanism (i.e. don't block when the database is down!) I think another problem with my existing code is that the connection my wrapper makes is totally separate from the connection that Appender::DBI makes. So even if my wrapper notices the disconnect and makes the reconnection -- Appender::DBI still has to reconnect. I still don't know why Appender::DBI failed to reconnect, but if the connections in my wrapper and the appender are separate, I can see that it makes the probability of error higher. Perhaps the answer is to write a true subclass of Appender::DBI instead of the kludge I came up with. I think I can just override the log() method with my own with something like: # Begin simplistic Pseudocode sub log () { if (not connected2database() ) { # Connection is down buffer_message() } else { write2database(@buffered_messages) } } sub connected2database { if (not $dbh->ping() ) { # try to reconnect - once eval { connect() } if ($@) { # connection successful, rebuild statement handle return 1; } else { return 0; } } } -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Robert Jacobson .......................... Flight Ops. Team Solar Dynamics Observatory (SDO) ............. .............. |
From: Mike S. <m...@pe...> - 2007-01-08 07:05:33
|
On Fri, 5 Jan 2007, Robert Jacobson wrote: > Nothing like a new year to find bugs! There is a bug in > DateFormat.pm -- it does not print leading zeroes. Also, it is > formatted as a string instead of a number. Thanks, applied to 1.09. -- Mike Mike Schilli m...@pe... > > Test program: > use Log::Log4perl::DateFormat; > my $format = Log::Log4perl::DateFormat->new("yyyy-DDD-HH:mm:ss"); > my $time = time(); > print $format->format($time), "\n"; > > => 2007- 5-09:38:44 > > patch: > > @@ -192,7 +192,7 @@ > ###################### > } elsif($first eq "D") { > push @{$self->{stack}}, [7, sub { $_[0] + 1}]; > - return "%${len}s"; > + return "%0" . $len . "d"; > > ###################### > #a - am/pm marker # > > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > Robert Jacobson .......................... > Flight Ops. Team Solar Dynamics Observatory (SDO) > ............. .............. > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |