Skip Menu |

This queue is for tickets about the Log-Dispatch-FileRotate CPAN distribution.

Report information
The Basics
Id: 41064
Status: resolved
Priority: 0/
Queue: Log-Dispatch-FileRotate

People
Owner: Nobody in particular
Requestors: bitcard [...] frederik.cjb.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 1.21



Subject: size field in external config file with perl-style underscore, e.g. size=2_000_000 is ignored
First, thanks for a very useful package. SHORT STORY: I noticed that "log4perl.appender.MYLOG.size=2_000_000" doesn't work. The cause, I believe, is the underscore in the number. LONG STORY: Based on examples found online (*) I used Log::Dispatch::FileRotate with an external config file which says: log4perl.logger.LNU=INFO, LNU_LOG log4perl.appender.LNU_LOG=Log::Dispatch::FileRotate log4perl.appender.LNU_LOG.filename=/logfiles/myprocess.log log4perl.appender.LNU_LOG.mode=append log4perl.appender.LNU_LOG.size=2_000_000 but to my surprise, files were growing to 10MB before rotating I believe the fault is in the "size=2_000_000", which clashes with the following number regex test in new() $size = $ten_meg unless $size =~ /^\d+$/ && $size < $two_gig && $size > 0; Maybe I was supposed to know that I shouldn't use perl format in the external file, but I didn't. So for the benefit of other users, I'd suggest to either document this, or adapt the code to allow this number format. The obvious workaround is to omit the underscores from the number. (*) e.g. here: http://lena.franken.de/perl_hier/log4perl.html (visited last on 2008-11-19)
On Wed Nov 19 08:13:17 2008, fhabils wrote: Show quoted text
> LONG STORY: > Based on examples found online (*) I used Log::Dispatch::FileRotate with > an external config file which says:
... Show quoted text
> log4perl.appender.LNU_LOG.size=2_000_000
... Show quoted text
First of all, thanks for your report. I realize this ticket is very old. I recently obtained COMAINT on this module and am working to resolve some of the open issues with this module. I'm not sure where the author of that page got the idea that its okay to use underscores in the numbers in the config files. Underscore-in-numbers only works in perl source code, and config files are not perl source code. Thankfully the referenced page has disappeared from the internet (its still in the wayback machine though). Nevertheless, it seems harmless enough to strip out underscores from size variables. I'll add a patch for that for the next release. -- Regards, Michael Schout
On Wed Nov 19 08:13:17 2008, fhabils wrote: Show quoted text
> LONG STORY: > Based on examples found online (*) I used Log::Dispatch::FileRotate with > an external config file which says:
... Show quoted text
> log4perl.appender.LNU_LOG.size=2_000_000
... Show quoted text
First of all, thanks for your report. I realize this ticket is very old. I recently obtained COMAINT on this module and am working to resolve some of the open issues with this module. I'm not sure where the author of that page got the idea that its okay to use underscores in the numbers in the config files. Underscore-in-numbers only works in perl source code, and config files are not perl source code. Thankfully the referenced page has disappeared from the internet (its still in the wayback machine though). Nevertheless, it seems harmless enough to strip out underscores from size variables. I'll add a patch for that for the next release. -- Regards, Michael Schout