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: Kevin M. G. <cp...@go...> - 2007-11-06 16:29:48
|
Mike Schilli wrote: > I see -- the recommended ways of synchronizing access to an appender are > listed in the Log4perl FAQ: > > http://log4perl.sourceforge.net/d/Log/Log4perl/FAQ.html#23804 Something I learned recently that's apropos that I've been meaning to mention: on Linux, you don't have to worry about interleaving messages when writing to the same file as long as the messages themselves are smaller than PIPE_BUF, which on my FC5 machine here is defined as 4096 bytes: $ grep -r PIPE_BUF /usr/include/ /usr/include/linux/limits.h:#define PIPE_BUF 4096 /* # bytes in atomic write to a pipe */ |
From: Mike S. <m...@pe...> - 2007-11-06 07:28:36
|
On Mon, 5 Nov 2007, Jonathan Swartz wrote: > Right, I expected that new categories would keep cropping up. Why > would it be a problem for an appender to open new filehandles on the > fly? Other than worrying about maximum # of filehandles? Categories are added at init() time, not at log() time. If you add a new category to Log4perl, you have to run init(). -- Mike Mike Schilli m...@pe... |
From: Mike S. <m...@pe...> - 2007-11-06 07:22:21
|
On Mon, 5 Nov 2007, Strahan, Bob wrote: > Looks like the syncer appender has a set of additional module > dependencies we don't have setup yet in our environment.. I'll try it > out when I get a change to get things set up. Actually, I was referring to the 'syswrite' option, which is often the easiest way to get non-interleaving log messages without further synchronization. -- Mike Mike Schilli m...@pe... > > > > > -----Original Message----- > From: Mike Schilli [mailto:m...@pe...] > Sent: Sunday, November 04, 2007 3:55 PM > To: Strahan, Bob > Cc: Mike Schilli; log...@li... > Subject: RE: [log4perl-devel] log4perl causing perl process to die (fwd) > > On Sun, 4 Nov 2007, Strahan, Bob wrote: > > > We do use the 'close_after_write' option... As I mentioned, there are > > multiple concurrent processes continually being spawned by the > > service, each using log4perl to log to the same logfile. So we > > figured we needed to use File::Locked along with close_after_write to > > ensure each process got an exclusive lock on the logfile before > > writing to it. > > I see -- the recommended ways of synchronizing access to an appender are > listed in the Log4perl FAQ: > > http://log4perl.sourceforge.net/d/Log/Log4perl/FAQ.html#23804 > > I'm not sure how well they work on Windows, though, but give the > 'syswrite' option a try, that should be the easiest. > > -- Mike > > Mike Schilli > m...@pe... > > > Let me know if there is a better (more efficient) way to handle > > multiple concurrent processes logging to the same file e.g. Would > > using socket appenders to route log messages to single log server > > process which handles file i/o from one process be a better option? > > > > > > > Which version of Windows are you running by the way? On regular XP, it > > > seems to work as expected. > > > > Windows 2003 64-bit server.. I haven't tried it on other flavors of Windows. > > > > > > For now I have worked around the problem by inserting the open() call into a retry loop.. > > #open $fh, "$self->{mode}$self->{filename}" > > # or die "Cannot write to '$self->{filename}': $!"; > > while (1) { > > last if open $fh, "$self->{mode}$self->{filename}" ; > > } > > > > > > > > > > > > > > > > > > -----Original Message----- > > From: log...@li... [mailto:log...@li...] On Behalf Of Mike Schilli > > Sent: Saturday, November 03, 2007 6:32 PM > > To: Mike Schilli > > Cc: log...@li... > > Subject: Re: [log4perl-devel] log4perl causing perl process to die (fwd) > > > > On Fri, 2 Nov 2007, Bob Strahan wrote: > > > > > However, it seems that if certain filesystem operations are > > > performed on the logfile it can cause the logger to execute die(), > > > causing my service to die, with the following error > > > > > > Cannot write to 'D:/Program Files (x86)/My App/logs/logfile.txt': > > > Permission denied at D:\Program Files (x86)\My > > > App\lib\perllibs\lib/Log/Dispatch/File.pm line 86. > > > > Hmm, this is Log::Dispatch::File's _open_file() function complaining > > that an open() failed. Does your service open a files after it's been > > running for a while? Typically, Log::Dispatch::File(::Locked) opens the > > file only once unless 'close_after_write' is given. > > > > Which version of Windows are you running by the way? On regular XP, it > > seems to work as expected. > > > > -- Mike > > > > Mike Schilli > > m...@pe... > > > > > I am using log4perl in a Win32 service that needs to run forever.. However, I have encountered a situation where the logger call is executing a die() and causing my service to die... > > > > > > > > > The service spawns multiple child processes which run concurrently but all log to the same logfile.. We're using File::Locked to avoid contention.. Extract from our logger config below.. > > > > > > "log4perl.appender.myapp" => "Log::Dispatch::File::Locked", > > > "log4perl.appender.myapp.filename" => "D:/Program Files (x86)/My App/logs/logfile.txt", > > > "log4perl.appender.myapp.mode" => "append", > > > "log4perl.appender.myapp.close_after_write" => "true", > > > "log4perl.appender.myapp.permissions" => "0660", > > > Etc.. > > > > > > > > > > > I can reproduce the problem sporadically by simply opening the logfile in Wordpad.. > > > I can reproduce it reliably by repeatedly copying the logfile using test script below > > > > > > #!perl -w > > > use File::Copy ; > > > while (1) { > > > copy ("D:/Program Files (x86)/My App/logs/logfile.txt", "D:/Program Files (x86)/My App/logs/logfileCOPY.txt") ; > > > print "." ; > > > } > > > > > > > > > Any suggestions on how to defend against users copying or opening the logfile? We should block and retry until open() suceeds, rather than die(), I think. > > > > > > Please let me know if you can help with a patch, workaround, or suggestion. > > > > > > Regards > > > > > > > > > > > > Bob Strahan > > > HP Software, R&D > > > > > > 703.579.1929 office | 702.967.5228 mobile | 702.579.1929 fax | bob...@hp...<mailto:bob...@hp...> > > > 10700 Parkridge Blvd. #500 | Reston | VA 20191 > > > > > > > > > ------------------------------------------------------------------------- > > > This SF.net email is sponsored by: Splunk Inc. > > > Still grepping through log files to find problems? Stop. > > > Now Search log events and configuration files using AJAX and a browser. > > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > > _______________________________________________ > > > log4perl-devel mailing list > > > log...@li... > > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > log4perl-devel mailing list > > log...@li... > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > > |
From: Jonathan S. <sw...@po...> - 2007-11-05 23:01:35
|
> On Sat, 3 Nov 2007, Mike Schilli wrote: > >> I'd like to write simultaneously to a central log file, and to >> a separate log file for each category. e.g. A log to category Foo.Bar >> would go to app.log and Foo.Bar.log. I want to do this automatically >> rather than having to configure each category separately. > > Interesting problem ... do you know ahead of time which categories > you're gonna run into? A script could call all kinds of Log4perl- > enabled > modules at runtime, adding new categories on-the-fly. > Right, I expected that new categories would keep cropping up. Why would it be a problem for an appender to open new filehandles on the fly? Other than worrying about maximum # of filehandles? Jon |
From: Strahan, B. <bob...@hp...> - 2007-11-05 22:36:07
|
Mike - I have more questions for you.. sorry - you've opened the floodgates= by being helpful first time :) I'd like to set up my multi-process perl app to support chainsaw as a log v= iewer.. I followed the instructions in the FAQ, and it worked.. but only if chainsa= w was up and running. But if chainsaw wasn't started, log4perl would die, complaining it couldn't= establish the connection. I discovered the 'silent_recovery' flag - but although this keeps the appli= cation from dying if chainsaw isn't running, it does very significantly slo= w down, as each log call is attempting (and failing) to establish a connect= ion to the non-existant chainsaw port. Any ideas how to configure things so I can use chainsaw, but avoid impact t= o the performance of the application if it's not running? Ideally I'd like to leverage the chainsaw's 'SocketHub' receiver, in order = to support multiple/remote chainsaw connections to my perl service.. I suspect that I'll need some sort of process that serves as a socket hub -= to accept multiple connections on PortA from my log4perl app, and zero or = more connections on portB from chainsaw - and route log4perl messages to an= y/all chainsaw connections? Have you done anything like this before? Any existing modules I can reuse f= or this? All pointers gratefully received.. Thanks Bob -----Original Message----- From: Mike Schilli [mailto:m...@pe...] Sent: Sunday, November 04, 2007 3:55 PM To: Strahan, Bob Cc: Mike Schilli; log...@li... Subject: RE: [log4perl-devel] log4perl causing perl process to die (fwd) On Sun, 4 Nov 2007, Strahan, Bob wrote: > We do use the 'close_after_write' option... As I mentioned, there are > multiple concurrent processes continually being spawned by the > service, each using log4perl to log to the same logfile. So we > figured we needed to use File::Locked along with close_after_write to > ensure each process got an exclusive lock on the logfile before > writing to it. I see -- the recommended ways of synchronizing access to an appender are listed in the Log4perl FAQ: http://log4perl.sourceforge.net/d/Log/Log4perl/FAQ.html#23804 I'm not sure how well they work on Windows, though, but give the 'syswrite' option a try, that should be the easiest. -- Mike Mike Schilli m...@pe... > Let me know if there is a better (more efficient) way to handle > multiple concurrent processes logging to the same file e.g. Would > using socket appenders to route log messages to single log server > process which handles file i/o from one process be a better option? > > > > Which version of Windows are you running by the way? On regular XP, it > > seems to work as expected. > > Windows 2003 64-bit server.. I haven't tried it on other flavors of Wind= ows. > > > For now I have worked around the problem by inserting the open() call int= o a retry loop.. > #open $fh, "$self->{mode}$self->{filename}" > # or die "Cannot write to '$self->{filename}': $!"; > while (1) { > last if open $fh, "$self->{mode}$self->{filename}" ; > } > > > > > > > > > -----Original Message----- > From: log...@li... [mailto:log4perl-devel= -bo...@li...] On Behalf Of Mike Schilli > Sent: Saturday, November 03, 2007 6:32 PM > To: Mike Schilli > Cc: log...@li... > Subject: Re: [log4perl-devel] log4perl causing perl process to die (fwd) > > On Fri, 2 Nov 2007, Bob Strahan wrote: > > > However, it seems that if certain filesystem operations are > > performed on the logfile it can cause the logger to execute die(), > > causing my service to die, with the following error > > > > Cannot write to 'D:/Program Files (x86)/My App/logs/logfile.txt': > > Permission denied at D:\Program Files (x86)\My > > App\lib\perllibs\lib/Log/Dispatch/File.pm line 86. > > Hmm, this is Log::Dispatch::File's _open_file() function complaining > that an open() failed. Does your service open a files after it's been > running for a while? Typically, Log::Dispatch::File(::Locked) opens the > file only once unless 'close_after_write' is given. > > Which version of Windows are you running by the way? On regular XP, it > seems to work as expected. > > -- Mike > > Mike Schilli > m...@pe... > > > I am using log4perl in a Win32 service that needs to run forever.. How= ever, I have encountered a situation where the logger call is executing a d= ie() and causing my service to die... > > > > > > The service spawns multiple child processes which run concurrently but = all log to the same logfile.. We're using File::Locked to avoid contention.= . Extract from our logger config below.. > > > > "log4perl.appender.myapp" =3D> "Log::Dispatch::File::Locked", > > "log4perl.appender.myapp.filename" =3D> "D:/Program Files (x86)/My App/= logs/logfile.txt", > > "log4perl.appender.myapp.mode" =3D> "append", > > "log4perl.appender.myapp.close_after_write" =3D> "true", > > "log4perl.appender.myapp.permissions" =3D> "0660", > > Etc.. > > > > > > > I can reproduce the problem sporadically by simply opening the logfile = in Wordpad.. > > I can reproduce it reliably by repeatedly copying the logfile using tes= t script below > > > > #!perl -w > > use File::Copy ; > > while (1) { > > copy ("D:/Program Files (x86)/My App/logs/logfile.txt", "D:/Program = Files (x86)/My App/logs/logfileCOPY.txt") ; > > print "." ; > > } > > > > > > Any suggestions on how to defend against users copying or opening the l= ogfile? We should block and retry until open() suceeds, rather than die()= , I think. > > > > Please let me know if you can help with a patch, workaround, or suggest= ion. > > > > Regards > > > > > > > > Bob Strahan > > -----------------------------------------------------------------------= -- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > log4perl-devel mailing list > > log...@li... > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |
From: Strahan, B. <bob...@hp...> - 2007-11-05 22:00:26
|
Thanks Mike.. Looks like the syncer appender has a set of additional module dependencies = we don't have setup yet in our environment.. I'll try it out when I get a c= hange to get things set up. -----Original Message----- From: Mike Schilli [mailto:m...@pe...] Sent: Sunday, November 04, 2007 3:55 PM To: Strahan, Bob Cc: Mike Schilli; log...@li... Subject: RE: [log4perl-devel] log4perl causing perl process to die (fwd) On Sun, 4 Nov 2007, Strahan, Bob wrote: > We do use the 'close_after_write' option... As I mentioned, there are > multiple concurrent processes continually being spawned by the > service, each using log4perl to log to the same logfile. So we > figured we needed to use File::Locked along with close_after_write to > ensure each process got an exclusive lock on the logfile before > writing to it. I see -- the recommended ways of synchronizing access to an appender are listed in the Log4perl FAQ: http://log4perl.sourceforge.net/d/Log/Log4perl/FAQ.html#23804 I'm not sure how well they work on Windows, though, but give the 'syswrite' option a try, that should be the easiest. -- Mike Mike Schilli m...@pe... > Let me know if there is a better (more efficient) way to handle > multiple concurrent processes logging to the same file e.g. Would > using socket appenders to route log messages to single log server > process which handles file i/o from one process be a better option? > > > > Which version of Windows are you running by the way? On regular XP, it > > seems to work as expected. > > Windows 2003 64-bit server.. I haven't tried it on other flavors of Wind= ows. > > > For now I have worked around the problem by inserting the open() call int= o a retry loop.. > #open $fh, "$self->{mode}$self->{filename}" > # or die "Cannot write to '$self->{filename}': $!"; > while (1) { > last if open $fh, "$self->{mode}$self->{filename}" ; > } > > > > > > > > > -----Original Message----- > From: log...@li... [mailto:log4perl-devel= -bo...@li...] On Behalf Of Mike Schilli > Sent: Saturday, November 03, 2007 6:32 PM > To: Mike Schilli > Cc: log...@li... > Subject: Re: [log4perl-devel] log4perl causing perl process to die (fwd) > > On Fri, 2 Nov 2007, Bob Strahan wrote: > > > However, it seems that if certain filesystem operations are > > performed on the logfile it can cause the logger to execute die(), > > causing my service to die, with the following error > > > > Cannot write to 'D:/Program Files (x86)/My App/logs/logfile.txt': > > Permission denied at D:\Program Files (x86)\My > > App\lib\perllibs\lib/Log/Dispatch/File.pm line 86. > > Hmm, this is Log::Dispatch::File's _open_file() function complaining > that an open() failed. Does your service open a files after it's been > running for a while? Typically, Log::Dispatch::File(::Locked) opens the > file only once unless 'close_after_write' is given. > > Which version of Windows are you running by the way? On regular XP, it > seems to work as expected. > > -- Mike > > Mike Schilli > m...@pe... > > > I am using log4perl in a Win32 service that needs to run forever.. How= ever, I have encountered a situation where the logger call is executing a d= ie() and causing my service to die... > > > > > > The service spawns multiple child processes which run concurrently but = all log to the same logfile.. We're using File::Locked to avoid contention.= . Extract from our logger config below.. > > > > "log4perl.appender.myapp" =3D> "Log::Dispatch::File::Locked", > > "log4perl.appender.myapp.filename" =3D> "D:/Program Files (x86)/My App/= logs/logfile.txt", > > "log4perl.appender.myapp.mode" =3D> "append", > > "log4perl.appender.myapp.close_after_write" =3D> "true", > > "log4perl.appender.myapp.permissions" =3D> "0660", > > Etc.. > > > > > > > I can reproduce the problem sporadically by simply opening the logfile = in Wordpad.. > > I can reproduce it reliably by repeatedly copying the logfile using tes= t script below > > > > #!perl -w > > use File::Copy ; > > while (1) { > > copy ("D:/Program Files (x86)/My App/logs/logfile.txt", "D:/Program = Files (x86)/My App/logs/logfileCOPY.txt") ; > > print "." ; > > } > > > > > > Any suggestions on how to defend against users copying or opening the l= ogfile? We should block and retry until open() suceeds, rather than die()= , I think. > > > > Please let me know if you can help with a patch, workaround, or suggest= ion. > > > > Regards > > > > > > > > Bob Strahan > > HP Software, R&D > > > > 703.579.1929 office | 702.967.5228 mobile | 702.579.1929 fax | bob.stra= ha...@hp...<mailto:bob...@hp...> > > 10700 Parkridge Blvd. #500 | Reston | VA 20191 > > > > > > -----------------------------------------------------------------------= -- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > log4perl-devel mailing list > > log...@li... > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |
From: Mike S. <m...@pe...> - 2007-11-04 20:55:34
|
On Sun, 4 Nov 2007, Strahan, Bob wrote: > We do use the 'close_after_write' option... As I mentioned, there are > multiple concurrent processes continually being spawned by the > service, each using log4perl to log to the same logfile. So we > figured we needed to use File::Locked along with close_after_write to > ensure each process got an exclusive lock on the logfile before > writing to it. I see -- the recommended ways of synchronizing access to an appender are listed in the Log4perl FAQ: http://log4perl.sourceforge.net/d/Log/Log4perl/FAQ.html#23804 I'm not sure how well they work on Windows, though, but give the 'syswrite' option a try, that should be the easiest. -- Mike Mike Schilli m...@pe... > Let me know if there is a better (more efficient) way to handle > multiple concurrent processes logging to the same file e.g. Would > using socket appenders to route log messages to single log server > process which handles file i/o from one process be a better option? > > > > Which version of Windows are you running by the way? On regular XP, it > > seems to work as expected. > > Windows 2003 64-bit server.. I haven't tried it on other flavors of Windows. > > > For now I have worked around the problem by inserting the open() call into a retry loop.. > #open $fh, "$self->{mode}$self->{filename}" > # or die "Cannot write to '$self->{filename}': $!"; > while (1) { > last if open $fh, "$self->{mode}$self->{filename}" ; > } > > > > > > > > > -----Original Message----- > From: log...@li... [mailto:log...@li...] On Behalf Of Mike Schilli > Sent: Saturday, November 03, 2007 6:32 PM > To: Mike Schilli > Cc: log...@li... > Subject: Re: [log4perl-devel] log4perl causing perl process to die (fwd) > > On Fri, 2 Nov 2007, Bob Strahan wrote: > > > However, it seems that if certain filesystem operations are > > performed on the logfile it can cause the logger to execute die(), > > causing my service to die, with the following error > > > > Cannot write to 'D:/Program Files (x86)/My App/logs/logfile.txt': > > Permission denied at D:\Program Files (x86)\My > > App\lib\perllibs\lib/Log/Dispatch/File.pm line 86. > > Hmm, this is Log::Dispatch::File's _open_file() function complaining > that an open() failed. Does your service open a files after it's been > running for a while? Typically, Log::Dispatch::File(::Locked) opens the > file only once unless 'close_after_write' is given. > > Which version of Windows are you running by the way? On regular XP, it > seems to work as expected. > > -- Mike > > Mike Schilli > m...@pe... > > > I am using log4perl in a Win32 service that needs to run forever.. However, I have encountered a situation where the logger call is executing a die() and causing my service to die... > > > > > > The service spawns multiple child processes which run concurrently but all log to the same logfile.. We're using File::Locked to avoid contention.. Extract from our logger config below.. > > > > "log4perl.appender.myapp" => "Log::Dispatch::File::Locked", > > "log4perl.appender.myapp.filename" => "D:/Program Files (x86)/My App/logs/logfile.txt", > > "log4perl.appender.myapp.mode" => "append", > > "log4perl.appender.myapp.close_after_write" => "true", > > "log4perl.appender.myapp.permissions" => "0660", > > Etc.. > > > > > > > I can reproduce the problem sporadically by simply opening the logfile in Wordpad.. > > I can reproduce it reliably by repeatedly copying the logfile using test script below > > > > #!perl -w > > use File::Copy ; > > while (1) { > > copy ("D:/Program Files (x86)/My App/logs/logfile.txt", "D:/Program Files (x86)/My App/logs/logfileCOPY.txt") ; > > print "." ; > > } > > > > > > Any suggestions on how to defend against users copying or opening the logfile? We should block and retry until open() suceeds, rather than die(), I think. > > > > Please let me know if you can help with a patch, workaround, or suggestion. > > > > Regards > > > > > > > > Bob Strahan > > HP Software, R&D > > > > 703.579.1929 office | 702.967.5228 mobile | 702.579.1929 fax | bob...@hp...<mailto:bob...@hp...> > > 10700 Parkridge Blvd. #500 | Reston | VA 20191 > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > log4perl-devel mailing list > > log...@li... > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |
From: Strahan, B. <bob...@hp...> - 2007-11-04 14:06:40
|
Hi Mike > Does your service open a files after it's been > running for a while? Typically, Log::Dispatch::File(::Locked) opens the > file only once unless 'close_after_write' is given. We do use the 'close_after_write' option... As I mentioned, there are multi= ple concurrent processes continually being spawned by the service, each usi= ng log4perl to log to the same logfile. So we figured we needed to use Fil= e::Locked along with close_after_write to ensure each process got an exclus= ive lock on the logfile before writing to it. Let me know if there is a better (more efficient) way to handle multiple co= ncurrent processes logging to the same file e.g. Would using socket appende= rs to route log messages to single log server process which handles file i/= o from one process be a better option? > Which version of Windows are you running by the way? On regular XP, it > seems to work as expected. Windows 2003 64-bit server.. I haven't tried it on other flavors of Window= s. For now I have worked around the problem by inserting the open() call into = a retry loop.. #open $fh, "$self->{mode}$self->{filename}" # or die "Cannot write to '$self->{filename}': $!"; while (1) { last if open $fh, "$self->{mode}$self->{filename}" ; } -----Original Message----- From: log...@li... [mailto:log4perl-devel-b= ou...@li...] On Behalf Of Mike Schilli Sent: Saturday, November 03, 2007 6:32 PM To: Mike Schilli Cc: log...@li... Subject: Re: [log4perl-devel] log4perl causing perl process to die (fwd) On Fri, 2 Nov 2007, Bob Strahan wrote: > However, it seems that if certain filesystem operations are > performed on the logfile it can cause the logger to execute die(), > causing my service to die, with the following error > > Cannot write to 'D:/Program Files (x86)/My App/logs/logfile.txt': > Permission denied at D:\Program Files (x86)\My > App\lib\perllibs\lib/Log/Dispatch/File.pm line 86. Hmm, this is Log::Dispatch::File's _open_file() function complaining that an open() failed. Does your service open a files after it's been running for a while? Typically, Log::Dispatch::File(::Locked) opens the file only once unless 'close_after_write' is given. Which version of Windows are you running by the way? On regular XP, it seems to work as expected. -- Mike Mike Schilli m...@pe... > I am using log4perl in a Win32 service that needs to run forever.. Howev= er, I have encountered a situation where the logger call is executing a die= () and causing my service to die... > > > The service spawns multiple child processes which run concurrently but al= l log to the same logfile.. We're using File::Locked to avoid contention.. = Extract from our logger config below.. > > "log4perl.appender.myapp" =3D> "Log::Dispatch::File::Locked", > "log4perl.appender.myapp.filename" =3D> "D:/Program Files (x86)/My App/lo= gs/logfile.txt", > "log4perl.appender.myapp.mode" =3D> "append", > "log4perl.appender.myapp.close_after_write" =3D> "true", > "log4perl.appender.myapp.permissions" =3D> "0660", > Etc.. > > > I can reproduce the problem sporadically by simply opening the logfile in= Wordpad.. > I can reproduce it reliably by repeatedly copying the logfile using test = script below > > #!perl -w > use File::Copy ; > while (1) { > copy ("D:/Program Files (x86)/My App/logs/logfile.txt", "D:/Program Fi= les (x86)/My App/logs/logfileCOPY.txt") ; > print "." ; > } > > > Any suggestions on how to defend against users copying or opening the log= file? We should block and retry until open() suceeds, rather than die(), = I think. > > Please let me know if you can help with a patch, workaround, or suggestio= n. > > Regards > > > > Bob Strahan > HP Software, R&D > > 703.579.1929 office | 702.967.5228 mobile | 702.579.1929 fax | bob.straha= n...@hp...<mailto:bob...@hp...> > 10700 Parkridge Blvd. #500 | Reston | VA 20191 > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ log4perl-devel mailing list log...@li... https://lists.sourceforge.net/lists/listinfo/log4perl-devel |
From: Mike S. <m...@pe...> - 2007-11-04 07:44:31
|
On Sat, 3 Nov 2007, Mike Schilli wrote: > I'd like to write simultaneously to a central log file, and to > a separate log file for each category. e.g. A log to category Foo.Bar > would go to app.log and Foo.Bar.log. I want to do this automatically > rather than having to configure each category separately. Interesting problem ... do you know ahead of time which categories you're gonna run into? A script could call all kinds of Log4perl-enabled modules at runtime, adding new categories on-the-fly. -- Mike Mike Schilli m...@pe... > Before I set out to create this, I was curious if anyone else has done > this and has advice, or if there is an existing appender/ dispatcher > that does this (couldn't find anything on cpan). > > Seems like one of the potential problems will be reaching a maximum > number of open file handles, given the large number of possible > categories. So I might have to maintain a "cache" of open > filehandles, closing old ones as needed when reaching a limit. > > Feedback appreciated. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |
From: Mike S. <m...@pe...> - 2007-11-04 02:28:08
|
From: Jonathan Swartz <sw...@po...> To: log...@li... Subject: appender/dispatcher that writes to per-category files Date: Thu, 1 Nov 2007 17:00:36 -0700 I'd like to write simultaneously to a central log file, and to a separate log file for each category. e.g. A log to category Foo.Bar would go to app.log and Foo.Bar.log. I want to do this automatically rather than having to configure each category separately. Before I set out to create this, I was curious if anyone else has done this and has advice, or if there is an existing appender/ dispatcher that does this (couldn't find anything on cpan). Seems like one of the potential problems will be reaching a maximum number of open file handles, given the large number of possible categories. So I might have to maintain a "cache" of open filehandles, closing old ones as needed when reaching a limit. Feedback appreciated. |
From: Mike S. <m...@pe...> - 2007-11-03 22:32:02
|
On Fri, 2 Nov 2007, Bob Strahan wrote: > However, it seems that if certain filesystem operations are > performed on the logfile it can cause the logger to execute die(), > causing my service to die, with the following error > > Cannot write to 'D:/Program Files (x86)/My App/logs/logfile.txt': > Permission denied at D:\Program Files (x86)\My > App\lib\perllibs\lib/Log/Dispatch/File.pm line 86. Hmm, this is Log::Dispatch::File's _open_file() function complaining that an open() failed. Does your service open a files after it's been running for a while? Typically, Log::Dispatch::File(::Locked) opens the file only once unless 'close_after_write' is given. Which version of Windows are you running by the way? On regular XP, it seems to work as expected. -- Mike Mike Schilli m...@pe... > I am using log4perl in a Win32 service that needs to run forever.. However, I have encountered a situation where the logger call is executing a die() and causing my service to die... > > > The service spawns multiple child processes which run concurrently but all log to the same logfile.. We're using File::Locked to avoid contention.. Extract from our logger config below.. > > "log4perl.appender.myapp" => "Log::Dispatch::File::Locked", > "log4perl.appender.myapp.filename" => "D:/Program Files (x86)/My App/logs/logfile.txt", > "log4perl.appender.myapp.mode" => "append", > "log4perl.appender.myapp.close_after_write" => "true", > "log4perl.appender.myapp.permissions" => "0660", > Etc.. > > > I can reproduce the problem sporadically by simply opening the logfile in Wordpad.. > I can reproduce it reliably by repeatedly copying the logfile using test script below > > #!perl -w > use File::Copy ; > while (1) { > copy ("D:/Program Files (x86)/My App/logs/logfile.txt", "D:/Program Files (x86)/My App/logs/logfileCOPY.txt") ; > print "." ; > } > > > Any suggestions on how to defend against users copying or opening the logfile? We should block and retry until open() suceeds, rather than die(), I think. > > Please let me know if you can help with a patch, workaround, or suggestion. > > Regards > > > > Bob Strahan > HP Software, R&D > > 703.579.1929 office | 702.967.5228 mobile | 702.579.1929 fax | bob...@hp...<mailto:bob...@hp...> > 10700 Parkridge Blvd. #500 | Reston | VA 20191 > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |
From: Mike S. <m...@pe...> - 2007-11-03 21:18:56
|
On Fri, 2 Nov 2007, Jeff McCarrell wrote: > I'm using log4perl in the obvious way. We have reqs to set the mode > of the log file to 0666. > log4perl.appender.PUSHD.filename=/tmp/pushd.log > log4perl.appender.PUSHD.mode=append > log4perl.appender.PUSHD.permissions > = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH # rotate among 5 log > files of 10Mbytes each log4perl.appender.PUSHD.size=100kb > log4perl.appender.PUSHD.max=5 > > results in 5 files of mode 0; permissions=0666 gets passed as a string > through the layers, not as an octal number, and results in: --w--wx-wT > 1 nobody nobody 1063 Nov 2 12:41 pushd.log* Unless you say explicitly that the right-hand side of a log4perl config line is Perl code, it's interpreted as a string. So, if you say log4perl.appender.PUSHD.permission = sub { use POSIX; S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH } instead, it'll work as intended. -- Mike Mike Schilli m...@pe... |
From: Mike S. <m...@pe...> - 2007-11-02 23:12:00
|
Forwarded with permission: ---------- Forwarded message ---------- From: "Strahan, Bob" <bob...@hp...> To: "log...@pe..." <log...@pe...> Subject: log4perl causing perl process to die Date: Fri, 2 Nov 2007 20:05:37 +0000 Hi I am using log4perl in a Win32 service that needs to run forever.. However, I have encountered a situation where the logger call is executing a die() and causing my service to die... The service spawns multiple child processes which run concurrently but all log to the same logfile.. We're using File::Locked to avoid contention.. Extract from our logger config below.. "log4perl.appender.myapp" => "Log::Dispatch::File::Locked", "log4perl.appender.myapp.filename" => "D:/Program Files (x86)/My App/logs/logfile.txt", "log4perl.appender.myapp.mode" => "append", "log4perl.appender.myapp.close_after_write" => "true", "log4perl.appender.myapp.permissions" => "0660", Etc.. However, it seems that if certain filesystem operations are performed on the logfile it can cause the logger to execute die(), causing my service to die, with the following error Cannot write to 'D:/Program Files (x86)/My App/logs/logfile.txt': Permission denied at D:\Program Files (x86)\My App\lib\perllibs\lib/Log/Dispatch/File.pm line 86. I can reproduce the problem sporadically by simply opening the logfile in Wordpad.. I can reproduce it reliably by repeatedly copying the logfile using test script below #!perl -w use File::Copy ; while (1) { copy ("D:/Program Files (x86)/My App/logs/logfile.txt", "D:/Program Files (x86)/My App/logs/logfileCOPY.txt") ; print "." ; } Any suggestions on how to defend against users copying or opening the logfile? We should block and retry until open() suceeds, rather than die(), I think. Please let me know if you can help with a patch, workaround, or suggestion. Regards Bob Strahan HP Software, R&D 703.579.1929 office | 702.967.5228 mobile | 702.579.1929 fax | bob...@hp...<mailto:bob...@hp...> 10700 Parkridge Blvd. #500 | Reston | VA 20191 |
From: Jeff M. <je...@ya...> - 2007-11-02 20:14:10
|
Hi folks. I'm using log4perl in the obvious way. We have reqs to set the mode of the log file to 0666. using log4perl.appender.PUSHD=Log::Dispatch::FileRotate log4perl.appender.PUSHD.filename=/tmp/pushd.log log4perl.appender.PUSHD.mode=append log4perl.appender.PUSHD.permissions = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH # rotate among 5 log files of 10Mbytes each log4perl.appender.PUSHD.size=100kb log4perl.appender.PUSHD.max=5 results in 5 files of mode 0; permissions=0666 gets passed as a string through the layers, not as an octal number, and results in: --w--wx-wT 1 nobody nobody 1063 Nov 2 12:41 pushd.log* Anyone have a recipe here that works? -- jeff |
From: Jeff M. <je...@ya...> - 2007-11-02 19:45:15
|
Hi folks. I'm using log4perl in the obvious way. We have reqs to set the mode of the log file to 0666. using log4perl.appender.PUSHD=Log::Dispatch::FileRotate log4perl.appender.PUSHD.filename=/tmp/pushd.log log4perl.appender.PUSHD.mode=append log4perl.appender.PUSHD.permissions = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH # rotate among 5 log files of 10Mbytes each log4perl.appender.PUSHD.size=100kb log4perl.appender.PUSHD.max=5 results in 5 files of mode 0; permissions=0666 gets passed as a string through the layers, not as an octal number, and results in: --w--wx-wT 1 nobody nobody 1063 Nov 2 12:41 pushd.log* Anyone have a recipe here that works? -- jeff |
From: Robert H. <si...@gm...> - 2007-10-12 14:20:46
|
Kudos for all the work! Robert |
From: Mike S. <m...@pe...> - 2007-10-12 02:49:25
|
Log4perl enthusiasts, the 1.13 maintenance release just made it to the project web site, here's what's changed: 1.13 (2007/10/11) * (ms) Another doc fix by Craig * (ms) Applied Fedora 7 patches * (ms) Added create_at_logtime option to file appender * (ms) Added trace level color (yellow) in ScreenColoredLevels appender as suggested by Arvind Jayaprakash in https://sourceforge.net/tracker/index.php? func=detail&aid=1791445&group_id=56939&atid=482388 If all goes well, it'll go to CPAN in a couple of days. Enjoy! -- Mike Mike Schilli m...@pe... |
From: Mike S. <m...@pe...> - 2007-10-09 23:13:35
|
On Tue, 9 Oct 2007, Jonathan Swartz wrote: > Let's say I've got several file appenders and a screen appender, and > I want them to use the same layout. There's no inheritance available (yet), but variable substitution should ease your pain at least a little bit: http://log4perl.sourceforge.net/d/Log/Log4perl.html#bd632 -- Mike Mike Schilli m...@pe... > > log4perl.appender.foofile = Log::Log4perl::Appender::File > log4perl.appender.foofile.filename = logs/foo.log > log4perl.appender.foofile.mode = append > log4perl.appender.foofile.layout = PatternLayout > log4perl.appender.foofile.layout.ConversionPattern = %d{dd/MMM/ > yyyy:HH:mm:ss.SS} [%p] %c - %m - %F:%L %P-%X{request_id}%n > > log4perl.appender.barfile = Log::Log4perl::Appender::File > log4perl.appender.barfile.filename = logs/bar.log > log4perl.appender.barfile.mode = append > log4perl.appender.barfile.layout = PatternLayout > log4perl.appender.barfile.layout.ConversionPattern = %d{dd/MMM/ > yyyy:HH:mm:ss.SS} [%p] %c - %m - %F:%L %P-%X{request_id}%n > > log4perl.appender.screen = Log::Log4perl::Appender::Screen > log4perl.appender.screen.layout = PatternLayout > log4perl.appender.screen.layout.ConversionPattern = %d{dd/MMM/ > yyyy:HH:mm:ss.SS} [%p] %c - %m - %F:%L %P-%X{request_id}%n > > This is rather tedious, to say the least. Is there any way to > abbreviate this in the config file, e.g. to specify common properties > of my standard appender and have the other appenders "inherit" from > it? Or do I have to resort to configuring from a hash if I want this > kind of expressiveness? > > Thanks > Jon > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |
From: Jonathan S. <sw...@po...> - 2007-10-09 22:22:08
|
Let's say I've got several file appenders and a screen appender, and I want them to use the same layout. log4perl.appender.foofile = Log::Log4perl::Appender::File log4perl.appender.foofile.filename = logs/foo.log log4perl.appender.foofile.mode = append log4perl.appender.foofile.layout = PatternLayout log4perl.appender.foofile.layout.ConversionPattern = %d{dd/MMM/ yyyy:HH:mm:ss.SS} [%p] %c - %m - %F:%L %P-%X{request_id}%n log4perl.appender.barfile = Log::Log4perl::Appender::File log4perl.appender.barfile.filename = logs/bar.log log4perl.appender.barfile.mode = append log4perl.appender.barfile.layout = PatternLayout log4perl.appender.barfile.layout.ConversionPattern = %d{dd/MMM/ yyyy:HH:mm:ss.SS} [%p] %c - %m - %F:%L %P-%X{request_id}%n log4perl.appender.screen = Log::Log4perl::Appender::Screen log4perl.appender.screen.layout = PatternLayout log4perl.appender.screen.layout.ConversionPattern = %d{dd/MMM/ yyyy:HH:mm:ss.SS} [%p] %c - %m - %F:%L %P-%X{request_id}%n This is rather tedious, to say the least. Is there any way to abbreviate this in the config file, e.g. to specify common properties of my standard appender and have the other appenders "inherit" from it? Or do I have to resort to configuring from a hash if I want this kind of expressiveness? Thanks Jon |
From: Berg, E. <eri...@le...> - 2007-09-27 17:35:43
|
Uh...right. I think that was wishful thinking on my part...I still want to have that file name somewhere. Thanks. I knew there was a good explanation. Eric. -----Original Message----- From: Mike Schilli =5Bmailto:m=40perlmeister.com=5D=20 Sent: Thursday, September 27, 2007 1:21 PM To: Berg, Eric Cc: Mike Schilli; gm_post=40br-online.de; log4perl-devel=40lists.sourceforge.net Subject: RE: =5Blog4perl-devel=5D Logger Properties On Thu, 27 Sep 2007, Berg, Eric wrote: > Well, that's good news, Mike, but what about the following did I not=20 > understand? The mail below referred to the configuration file name, while the previous mail referred to the output file name the file appender uses. Two entirely different animals=21 :) -- Mike Mike Schilli m=40perlmeister.com > This would be nice to have in the docs. > > Thanks. > > -Eric. > > > -----Original Message----- > > From: Mike Schilli =3D5Bmailto:m=3D40perlmeister.com=3D5D > > Sent: Thursday, June 28, 2007 7:54 PM > > To: Berg, Eric > > Cc: log4perl-devel=3D40lists.sourceforge.net > > Subject: Re: =3D5Blog4perl-devel=3D5D When a missing config file > > > > On Thu, 28 Jun 2007, Berg, Eric wrote: > > > > > I've been looking for a way to get l4p to tell me where the > config=3D20 > > > under which it's running comes from. Essentially, I'd like to > have=3D20 > > > a method that would return the full path to the config file=20 > > > that=3D20 it's currently using. > > > > > > Obviously, there are complications, such as those relating to=3D20=20 > > > programatic configuration subsequent to loading configs from a=20 > > > file, > > > > in-line, and config (ini) files, but I could find nowhere that > the=3D20 > > > file name passed in to init() is retrievable. > > > > The name of the file isn't stored usually, since you can not only > use=3D20 > > a file but a string, a hashref, an URL, etc. to initialize L4p. > > > > Since you're calling init() in the first place, wouldn't it be > easier=3D20 > > to store the filename in your application instead? > > > > -- Mike > > -----Original Message----- > From: Mike Schilli =5Bmailto:m=40perlmeister.com=5D > Sent: Thursday, September 27, 2007 3:29 AM > To: Berg, Eric > Cc: gm_post=40br-online.de; log4perl-devel=40lists.sourceforge.net > Subject: Re: =5Blog4perl-devel=5D Logger Properties > > On Wed, 26 Sep 2007, Berg, Eric wrote: > > > The answer was that that information isn't kept. For one thing, it=20 > > could be that the configuration was derived or modified=20 > > programatically. > > That's not accurate. Of course it's kept, otherwise the file appender=20 > wouldn't know what the name of the file is, right? :) > > To find the name of the file the file appender is using, first obtain=20 > a reference to the file appender. If you have a configuration like > > log4perl.category.Bar.Twix =3D WARN, Logfile > log4perl.appender.Logfile =3D Log::Log4perl::Appender::File > log4perl.appender.Logfile.filename =3D test.log > ... > > then find the =22Logfile=22 appender via > > my =24app =3D Log::Log4perl->appender_by_name(=22Logfile=22); > > and to obtain the name of the logfile it's using, call its 'filename' > method: > > print =24app->filename(), =22=5Cn=22; > > -- Mike > > Mike Schilli > m=40perlmeister.com > > > > > Nonethless, I think that there are times when it would be very=20 > > helpful > > > to have a path/filename for the config file. One of these days, if=20 > > I get some time........ > > > > Eric. > > > > -----Original Message----- > > From: log4perl-devel-bounces=40lists.sourceforge.net > > =5Bmailto:log4perl-devel-bounces=40lists.sourceforge.net=5D On Behalf = Of=20 > > gm_post=40br-online.de > > Sent: Wednesday, September 26, 2007 5:21 AM > > To: log4perl-devel=40lists.sourceforge.net > > Subject: =5Blog4perl-devel=5D Logger Properties > > > > Hi, > > > > know somebody how can I get the properties of a logger i.e. name of=20 > > used logfile? In log4perl manual I don't fint any hint. > > > > Example: > > > > =24logger =3D Log::Log4perl->get_logger('loggername'); > > > > I miss something like: > > > > %properties =3D =24logger->get_logger_properties(); =24current_logfile = =3D=20 > > =24properties=7Bfilename=7D; > > > > Thanks Gerd - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - = - - - - - - - This message is intended only for the personal and confidential use of the = designated recipient(s) named above. If you are not the intended = recipient of this message you are hereby notified that any review, = dissemination, distribution or copying of this message is strictly = prohibited. This communication is for information purposes only and = should not be regarded as an offer to sell or as a solicitation of an = offer to buy any financial product, an official confirmation of any = transaction, or as an official statement of Lehman Brothers. Email = transmission cannot be guaranteed to be secure or error-free. Therefore, = we do not represent that this information is complete or accurate and it = should not be relied upon as such. All information is subject to change = without notice. -------- IRS Circular 230 Disclosure: Please be advised that any discussion of U.S. tax matters contained within = this communication (including any attachments) is not intended or written = to be used and cannot be used for the purpose of (i) avoiding U.S. tax = related penalties or (ii) promoting, marketing or recommending to another = party any transaction or matter addressed herein. |
From: Mike S. <m...@pe...> - 2007-09-27 17:21:02
|
On Thu, 27 Sep 2007, Berg, Eric wrote: > Well, that's good news, Mike, but what about the following did I not > understand? The mail below referred to the configuration file name, while the previous mail referred to the output file name the file appender uses. Two entirely different animals! :) -- Mike Mike Schilli m...@pe... > This would be nice to have in the docs. > > Thanks. > > -Eric. > > > -----Original Message----- > > From: Mike Schilli =5Bmailto:m=40perlmeister.com=5D > > Sent: Thursday, June 28, 2007 7:54 PM > > To: Berg, Eric > > Cc: log4perl-devel=40lists.sourceforge.net > > Subject: Re: =5Blog4perl-devel=5D When a missing config file > > > > On Thu, 28 Jun 2007, Berg, Eric wrote: > > > > > I've been looking for a way to get l4p to tell me where the > config=20 > > > under which it's running comes from. Essentially, I'd like to > have=20 > > > a method that would return the full path to the config file that=20 > > > it's currently using. > > > > > > Obviously, there are complications, such as those relating to=20 > > > programatic configuration subsequent to loading configs from a file, > > > > in-line, and config (ini) files, but I could find nowhere that > the=20 > > > file name passed in to init() is retrievable. > > > > The name of the file isn't stored usually, since you can not only > use=20 > > a file but a string, a hashref, an URL, etc. to initialize L4p. > > > > Since you're calling init() in the first place, wouldn't it be > easier=20 > > to store the filename in your application instead? > > > > -- Mike > > -----Original Message----- > From: Mike Schilli [mailto:m...@pe...] > Sent: Thursday, September 27, 2007 3:29 AM > To: Berg, Eric > Cc: gm...@br...; log...@li... > Subject: Re: [log4perl-devel] Logger Properties > > On Wed, 26 Sep 2007, Berg, Eric wrote: > > > The answer was that that information isn't kept. For one thing, it > > could be that the configuration was derived or modified > > programatically. > > That's not accurate. Of course it's kept, otherwise the file appender > wouldn't know what the name of the file is, right? :) > > To find the name of the file the file appender is using, first obtain a > reference to the file appender. If you have a configuration like > > log4perl.category.Bar.Twix = WARN, Logfile > log4perl.appender.Logfile = Log::Log4perl::Appender::File > log4perl.appender.Logfile.filename = test.log > ... > > then find the "Logfile" appender via > > my $app = Log::Log4perl->appender_by_name("Logfile"); > > and to obtain the name of the logfile it's using, call its 'filename' > method: > > print $app->filename(), "\n"; > > -- Mike > > Mike Schilli > m...@pe... > > > > > Nonethless, I think that there are times when it would be very helpful > > > to have a path/filename for the config file. One of these days, if I > > get some time........ > > > > Eric. > > > > -----Original Message----- > > From: log...@li... > > [mailto:log...@li...] On Behalf Of > > gm...@br... > > Sent: Wednesday, September 26, 2007 5:21 AM > > To: log...@li... > > Subject: [log4perl-devel] Logger Properties > > > > Hi, > > > > know somebody how can I get the properties of a logger i.e. name of > > used logfile? In log4perl manual I don't fint any hint. > > > > Example: > > > > $logger = Log::Log4perl->get_logger('loggername'); > > > > I miss something like: > > > > %properties = $logger->get_logger_properties(); $current_logfile = > > $properties{filename}; > > > > Thanks Gerd > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > - - - - - - - - - > > > > This message is intended only for the personal and confidential use of > the designated recipient(s) named above. If you are not the intended > recipient of this message you are hereby notified that any review, > dissemination, distribution or copying of this message is strictly > prohibited. This communication is for information purposes only and > should not be regarded as an offer to sell or as a solicitation of an > offer to buy any financial product, an official confirmation of any > transaction, or as an official statement of Lehman Brothers. Email > transmission cannot be guaranteed to be secure or error-free. > Therefore, we do not represent that this information is complete or > accurate and it should not be relied upon as such. All information is > subject to change without notice. > > > > -------- > > IRS Circular 230 Disclosure: > > Please be advised that any discussion of U.S. tax matters contained > within this communication (including any attachments) is not intended or > written to be used and cannot be used for the purpose of (i) avoiding > U.S. tax related penalties or (ii) promoting, marketing or recommending > to another party any transaction or matter addressed herein. > > > > > > > > ---------------------------------------------------------------------- > > --- This SF.net email is sponsored by: Microsoft Defy all challenges. > > Microsoft(R) Visual Studio 2005. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > log4perl-devel mailing list > > log...@li... > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. > > -------- > IRS Circular 230 Disclosure: > Please be advised that any discussion of U.S. tax matters contained within this communication (including any attachments) is not intended or written to be used and cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein. > > > |
From: Berg, E. <eri...@le...> - 2007-09-27 13:03:07
|
Well, that's good news, Mike, but what about the following did I not understand? When you said =22isn't stored usually=22, I guess you meant that, if there a file is used, it is. This would be nice to have in the docs. Thanks. -Eric. > -----Original Message----- > From: Mike Schilli =3D5Bmailto:m=3D40perlmeister.com=3D5D > Sent: Thursday, June 28, 2007 7:54 PM > To: Berg, Eric > Cc: log4perl-devel=3D40lists.sourceforge.net > Subject: Re: =3D5Blog4perl-devel=3D5D When a missing config file > > On Thu, 28 Jun 2007, Berg, Eric wrote: > > > I've been looking for a way to get l4p to tell me where the config=3D20 > > under which it's running comes from. Essentially, I'd like to have=3D20 > > a method that would return the full path to the config file that=3D20 > > it's currently using. > > > > Obviously, there are complications, such as those relating to=3D20 > > programatic configuration subsequent to loading configs from a file, > > in-line, and config (ini) files, but I could find nowhere that the=3D20 > > file name passed in to init() is retrievable. > > The name of the file isn't stored usually, since you can not only use=3D20 > a file but a string, a hashref, an URL, etc. to initialize L4p. > > Since you're calling init() in the first place, wouldn't it be easier=3D20 > to store the filename in your application instead? > > -- Mike=20 -----Original Message----- From: Mike Schilli =5Bmailto:m=40perlmeister.com=5D=20 Sent: Thursday, September 27, 2007 3:29 AM To: Berg, Eric Cc: gm_post=40br-online.de; log4perl-devel=40lists.sourceforge.net Subject: Re: =5Blog4perl-devel=5D Logger Properties On Wed, 26 Sep 2007, Berg, Eric wrote: > The answer was that that information isn't kept. For one thing, it=20 > could be that the configuration was derived or modified=20 > programatically. That's not accurate. Of course it's kept, otherwise the file appender wouldn't know what the name of the file is, right? :) To find the name of the file the file appender is using, first obtain a reference to the file appender. If you have a configuration like log4perl.category.Bar.Twix =3D WARN, Logfile log4perl.appender.Logfile =3D Log::Log4perl::Appender::File log4perl.appender.Logfile.filename =3D test.log ... then find the =22Logfile=22 appender via my =24app =3D Log::Log4perl->appender_by_name(=22Logfile=22); and to obtain the name of the logfile it's using, call its 'filename' method: print =24app->filename(), =22=5Cn=22; -- Mike Mike Schilli m=40perlmeister.com > > Nonethless, I think that there are times when it would be very helpful > to have a path/filename for the config file. One of these days, if I=20 > get some time........ > > Eric. > > -----Original Message----- > From: log4perl-devel-bounces=40lists.sourceforge.net > =5Bmailto:log4perl-devel-bounces=40lists.sourceforge.net=5D On Behalf = Of=20 > gm_post=40br-online.de > Sent: Wednesday, September 26, 2007 5:21 AM > To: log4perl-devel=40lists.sourceforge.net > Subject: =5Blog4perl-devel=5D Logger Properties > > Hi, > > know somebody how can I get the properties of a logger i.e. name of=20 > used logfile? In log4perl manual I don't fint any hint. > > Example: > > =24logger =3D Log::Log4perl->get_logger('loggername'); > > I miss something like: > > %properties =3D =24logger->get_logger_properties(); =24current_logfile = =3D=20 > =24properties=7Bfilename=7D; > > Thanks Gerd > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -=20 > - - - - - - - - - > > This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. > > -------- > IRS Circular 230 Disclosure: > Please be advised that any discussion of U.S. tax matters contained within this communication (including any attachments) is not intended or written to be used and cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein. > > > > ---------------------------------------------------------------------- > --- This SF.net email is sponsored by: Microsoft Defy all challenges.=20 > Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > log4perl-devel mailing list > log4perl-devel=40lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - = - - - - - - - This message is intended only for the personal and confidential use of the = designated recipient(s) named above. If you are not the intended = recipient of this message you are hereby notified that any review, = dissemination, distribution or copying of this message is strictly = prohibited. This communication is for information purposes only and = should not be regarded as an offer to sell or as a solicitation of an = offer to buy any financial product, an official confirmation of any = transaction, or as an official statement of Lehman Brothers. Email = transmission cannot be guaranteed to be secure or error-free. Therefore, = we do not represent that this information is complete or accurate and it = should not be relied upon as such. All information is subject to change = without notice. -------- IRS Circular 230 Disclosure: Please be advised that any discussion of U.S. tax matters contained within = this communication (including any attachments) is not intended or written = to be used and cannot be used for the purpose of (i) avoiding U.S. tax = related penalties or (ii) promoting, marketing or recommending to another = party any transaction or matter addressed herein. |
From: Mike S. <m...@pe...> - 2007-09-27 07:29:44
|
On Wed, 26 Sep 2007, Berg, Eric wrote: > The answer was that that information isn't kept. For one thing, it > could be that the configuration was derived or modified > programatically. That's not accurate. Of course it's kept, otherwise the file appender wouldn't know what the name of the file is, right? :) To find the name of the file the file appender is using, first obtain a reference to the file appender. If you have a configuration like log4perl.category.Bar.Twix = WARN, Logfile log4perl.appender.Logfile = Log::Log4perl::Appender::File log4perl.appender.Logfile.filename = test.log ... then find the "Logfile" appender via my $app = Log::Log4perl->appender_by_name("Logfile"); and to obtain the name of the logfile it's using, call its 'filename' method: print $app->filename(), "\n"; -- Mike Mike Schilli m...@pe... > > Nonethless, I think that there are times when it would be very helpful > to have a path/filename for the config file. One of these days, if I > get some time........ > > Eric. > > -----Original Message----- > From: log...@li... > [mailto:log...@li...] On Behalf Of > gm...@br... > Sent: Wednesday, September 26, 2007 5:21 AM > To: log...@li... > Subject: [log4perl-devel] Logger Properties > > Hi, > > know somebody how can I get the properties of a logger i.e. name of used > logfile? In log4perl manual I don't fint any hint. > > Example: > > $logger = Log::Log4perl->get_logger('loggername'); > > I miss something like: > > %properties = $logger->get_logger_properties(); $current_logfile = > $properties{filename}; > > Thanks Gerd > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. > > -------- > IRS Circular 230 Disclosure: > Please be advised that any discussion of U.S. tax matters contained within this communication (including any attachments) is not intended or written to be used and cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein. > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |
From: Berg, E. <eri...@le...> - 2007-09-26 17:38:44
|
I had asked about his a little while ago, Gerd. The answer was that that information isn't kept. For one thing, it could be that the configuration was derived or modified programatically. Nonethless, I think that there are times when it would be very helpful to have a path/filename for the config file. One of these days, if I get some time........ Eric. -----Original Message----- From: log4perl-devel-bounces=40lists.sourceforge.net =5Bmailto:log4perl-devel-bounces=40lists.sourceforge.net=5D On Behalf Of gm_post=40br-online.de Sent: Wednesday, September 26, 2007 5:21 AM To: log4perl-devel=40lists.sourceforge.net Subject: =5Blog4perl-devel=5D Logger Properties Hi, know somebody how can I get the properties of a logger i.e. name of used logfile? In log4perl manual I don't fint any hint. Example: =24logger =3D Log::Log4perl->get_logger('loggername'); I miss something like: %properties =3D =24logger->get_logger_properties(); =24current_logfile =3D =24properties=7Bfilename=7D; Thanks Gerd - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - = - - - - - - - This message is intended only for the personal and confidential use of the = designated recipient(s) named above. If you are not the intended = recipient of this message you are hereby notified that any review, = dissemination, distribution or copying of this message is strictly = prohibited. This communication is for information purposes only and = should not be regarded as an offer to sell or as a solicitation of an = offer to buy any financial product, an official confirmation of any = transaction, or as an official statement of Lehman Brothers. Email = transmission cannot be guaranteed to be secure or error-free. Therefore, = we do not represent that this information is complete or accurate and it = should not be relied upon as such. All information is subject to change = without notice. -------- IRS Circular 230 Disclosure: Please be advised that any discussion of U.S. tax matters contained within = this communication (including any attachments) is not intended or written = to be used and cannot be used for the purpose of (i) avoiding U.S. tax = related penalties or (ii) promoting, marketing or recommending to another = party any transaction or matter addressed herein. |
From: <gm...@br...> - 2007-09-26 09:21:02
|
Hi, know somebody how can I get the properties of a logger i.e. name of used logfile? In log4perl manual I don't fint any hint. Example: $logger = Log::Log4perl->get_logger('loggername'); I miss something like: %properties = $logger->get_logger_properties(); $current_logfile = $properties{filename}; Thanks Gerd ----------------------------------------------------- Gerd Mucha BR-Online Rundfunkplatz 1 80300 München Tel: 089/5900 16024 Fax: 089/5900 16000 gm...@br... ----------------------------------------------------- |