You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(38) |
Sep
(126) |
Oct
(23) |
Nov
(72) |
Dec
(36) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(76) |
Feb
(32) |
Mar
(19) |
Apr
(6) |
May
(54) |
Jun
(40) |
Jul
(45) |
Aug
(35) |
Sep
(51) |
Oct
(67) |
Nov
(10) |
Dec
(50) |
| 2004 |
Jan
(51) |
Feb
(22) |
Mar
(22) |
Apr
(28) |
May
(53) |
Jun
(99) |
Jul
(38) |
Aug
(49) |
Sep
(23) |
Oct
(29) |
Nov
(30) |
Dec
(48) |
| 2005 |
Jan
(15) |
Feb
(21) |
Mar
(25) |
Apr
(16) |
May
(131) |
Jun
|
Jul
(8) |
Aug
(5) |
Sep
(15) |
Oct
|
Nov
(15) |
Dec
(12) |
| 2006 |
Jan
(15) |
Feb
(20) |
Mar
(8) |
Apr
(10) |
May
(3) |
Jun
(16) |
Jul
(15) |
Aug
(11) |
Sep
(17) |
Oct
(27) |
Nov
(11) |
Dec
(12) |
| 2007 |
Jan
(19) |
Feb
(18) |
Mar
(33) |
Apr
(4) |
May
(15) |
Jun
(22) |
Jul
(19) |
Aug
(20) |
Sep
(14) |
Oct
(4) |
Nov
(34) |
Dec
(11) |
| 2008 |
Jan
(8) |
Feb
(18) |
Mar
(2) |
Apr
(4) |
May
(26) |
Jun
(9) |
Jul
(8) |
Aug
(8) |
Sep
(3) |
Oct
(17) |
Nov
(14) |
Dec
(4) |
| 2009 |
Jan
(6) |
Feb
(41) |
Mar
(21) |
Apr
(10) |
May
(21) |
Jun
|
Jul
(8) |
Aug
(4) |
Sep
(3) |
Oct
(8) |
Nov
(6) |
Dec
(5) |
| 2010 |
Jan
(14) |
Feb
(13) |
Mar
(7) |
Apr
(12) |
May
(4) |
Jun
(1) |
Jul
(11) |
Aug
(5) |
Sep
|
Oct
(1) |
Nov
(10) |
Dec
|
| 2011 |
Jan
(7) |
Feb
(3) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(1) |
Jul
(6) |
Aug
(6) |
Sep
(10) |
Oct
(5) |
Nov
(4) |
Dec
(5) |
| 2012 |
Jan
(4) |
Feb
(5) |
Mar
(1) |
Apr
(7) |
May
(1) |
Jun
|
Jul
(2) |
Aug
|
Sep
(5) |
Oct
(5) |
Nov
(4) |
Dec
(5) |
| 2013 |
Jan
(6) |
Feb
|
Mar
(14) |
Apr
(9) |
May
(3) |
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
(4) |
Dec
(6) |
| 2014 |
Jan
|
Feb
(1) |
Mar
(10) |
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
(1) |
Nov
|
Dec
(4) |
| 2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
|
From: Viner, D. <dv...@ya...> - 2003-09-24 23:56:14
|
Hi,
Sorry for this newbie question. I looked at the docs, but I couldn't
find an answer. I want to use a file-based logger, like Log::Dispatch::File
or something similar, and have a logger object initialized in a parent
process. When the parent forks a child, that child process will have a copy
of the logger object. Can I safely use that duplicate logger object in the
child? Or will that causes messages from the parent and child to
interleave?
I'm not concerned about mixing complete messages from child and parent
like this:
parent > msg1
child > msg2
But, what really concerns me is the interleaving of messages in the same
line like this:
parchild > ent > msmsg1g2
Is there protection against this? Or should the forked child call
Log::Log4perl->reset(); Log::Log4perl->init() to get a seperate logger
object?
thanks again.
dave viner
p.s. - i realize this question is similar to the question posed in the
Apache::Reload email, but I wanted to clarify for my application (which
doesn't use apache or mod_perl).
|
|
From: Kevin G. <ke...@go...> - 2003-09-24 23:54:07
|
David, thanks for the investigation and the patch, but the problem is
actually that JavaMap::RollingFileAppender isn't meant to be used
directly as an appender, it's only there as a translation layer if you
want to use java syntax, so that people can do
log4perl.appender.FR1 = \
org.apache.log4j.RollingFileAppender
and use the attribute names from log4j.
If you just want to use FileRotate and don't care about being compatible
with the java log4j, you can just say
log4perl.appender.FR1 = \
Log::Dispatch::FileRotate
It's an understandable mistake, though. Maybe I should put a note about
that in the docs.
Viner, David wrote:
> After some more digging, I think I've found the problem.
>
> Log::Log4perl::JavaMap::RollingFileAppender is a wrapper around
> Log::Dispatch::FileRotate. This module uses the token 'debug' as a flag to
> toggle internal debugging statements. I believe that this causes a conflict
> with the Log::Log4perl's expections of the 'debug' token in the hash that is
> $self.
>
> The attached patch to Log::Dispatch::FileRotate fixes the problem for
> Log::Log4perl. Mark, as the owner of the FileRotate module, can you review
> this patch?
>
> thanks
> dave viner
>
>
> -----Original Message-----
> From: Viner, David [mailto:dv...@ya...]
> Sent: Wednesday, September 24, 2003 10:47 AM
> To: 'log...@li...'
> Subject: [log4perl-devel] use strict and JavaMap::RollingFileAppender
> problem
>
>
> Hi,
> I'm trying to use the RollingFileAppender, but I keep getting this
> error:
>
> Can't use string ("debug") as a HASH ref while "strict refs" in use at
> /home/y/lib/perl5/site_perl/5.6.1/Log/Log4perl/JavaMap/RollingFileAppender.p
> m line 12.
>
> My log config file is really simple:
>
> log4perl.logger.test = DEBUG, FR1
> log4perl.appender.FR1 =
> Log::Log4perl::JavaMap::RollingFileAppender
> log4perl.appender.FR1.Threshold = DEBUG
> log4perl.appender.FR1.layout = Log::Log4perl::Layout::PatternLayout
> log4perl.appender.FR1.layout.ConversionPattern = \
> %d %p> %F{1}:%L %M - %m%n
> log4perl.appender.FR1.filename = test.log
> log4perl.appender.FR1.mode = append
> log4perl.appender.FR1.autoflush = 1
> log4perl.appender.FR1.size = 2
> log4perl.appender.FR1.max = 2
>
> and my script is equally simple:
>
> #!/usr/local/bin/perl -w
>
> use strict;
> use Log::Log4perl qw|get_logger|;
>
> use constant LOGGER_NAME => 'test';
>
> Log::Log4perl->init_and_watch('log.conf', 60);
> my $logger = get_logger(LOGGER_NAME);
>
> for(my $i=0; $i<100000; $i++)
> {
> $logger->debug("Message number $i is hello");
> }
>
>
> I'm using version 0.36 of Log::Log4perl and perl 5.6.1.
>
> Am I doing something wrong? Or is this a known problem with a work-around?
>
> thanks
> dave viner
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> log4perl-devel mailing list
> log...@li...
> https://lists.sourceforge.net/lists/listinfo/log4perl-devel
>
>
--
Happy Trails . . .
Kevin M. Goess
(and Anne and Frank)
904 Carmel Ave.
Albany, CA 94706
(510) 525-5217
|
|
From: William M. <wi...@kn...> - 2003-09-24 23:24:03
|
Hi Mike, Thanks for the prompt reply! Indeed inserting the reset worked. I discovered that the behavior occurs each time I ran my subroutine, not just when Apache::Reload got called. Given your explanation, this behavior makes sense because I am calling init each time it is run. So the init function currently creates a new logger object, and I'm basically firing off new ones every time my script runs. It's like a giant fireworks show (which is also what my logs start to look like after several runs <g>). Regards, William -- Knowmad Services Inc. http://www.knowmad.com |
|
From: Mark P. <ma...@ml...> - 2003-09-24 23:21:32
|
David, the patch looks OK. I'll roll out a new version incorporating
something like it in the next 24-48hrs.
cheers
markpf
----------------------------------------------------------------------------
Mark Pfeiffer |Email : Mar...@ml...
Computer Systems Engineer |Snail : PO Box 334, Oatley, NSW, 2223, Australia
MLP Consulting Pty. Ltd |Phone : 0417 447 538
----------------------------------------------------------------------------
On Sep 24, Viner, David's good news was:
> After some more digging, I think I've found the problem.
>
> Log::Log4perl::JavaMap::RollingFileAppender is a wrapper around
> Log::Dispatch::FileRotate. This module uses the token 'debug' as a flag to
> toggle internal debugging statements. I believe that this causes a conflict
> with the Log::Log4perl's expections of the 'debug' token in the hash that is
> $self.
>
> The attached patch to Log::Dispatch::FileRotate fixes the problem for
> Log::Log4perl. Mark, as the owner of the FileRotate module, can you review
> this patch?
>
> thanks
> dave viner
>
>
> -----Original Message-----
> From: Viner, David [mailto:dv...@ya...]
> Sent: Wednesday, September 24, 2003 10:47 AM
> To: 'log...@li...'
> Subject: [log4perl-devel] use strict and JavaMap::RollingFileAppender
> problem
>
>
> Hi,
> I'm trying to use the RollingFileAppender, but I keep getting this
> error:
>
> Can't use string ("debug") as a HASH ref while "strict refs" in use at
> /home/y/lib/perl5/site_perl/5.6.1/Log/Log4perl/JavaMap/RollingFileAppender.p
> m line 12.
>
> My log config file is really simple:
>
> log4perl.logger.test = DEBUG, FR1
> log4perl.appender.FR1 =
> Log::Log4perl::JavaMap::RollingFileAppender
> log4perl.appender.FR1.Threshold = DEBUG
> log4perl.appender.FR1.layout = Log::Log4perl::Layout::PatternLayout
> log4perl.appender.FR1.layout.ConversionPattern = \
> %d %p> %F{1}:%L %M - %m%n
> log4perl.appender.FR1.filename = test.log
> log4perl.appender.FR1.mode = append
> log4perl.appender.FR1.autoflush = 1
> log4perl.appender.FR1.size = 2
> log4perl.appender.FR1.max = 2
>
> and my script is equally simple:
>
> #!/usr/local/bin/perl -w
>
> use strict;
> use Log::Log4perl qw|get_logger|;
>
> use constant LOGGER_NAME => 'test';
>
> Log::Log4perl->init_and_watch('log.conf', 60);
> my $logger = get_logger(LOGGER_NAME);
>
> for(my $i=0; $i<100000; $i++)
> {
> $logger->debug("Message number $i is hello");
> }
>
>
> I'm using version 0.36 of Log::Log4perl and perl 5.6.1.
>
> Am I doing something wrong? Or is this a known problem with a work-around?
>
> thanks
> dave viner
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> log4perl-devel mailing list
> log...@li...
> https://lists.sourceforge.net/lists/listinfo/log4perl-devel
>
>
>
|
|
From: Mike S. <msc...@ao...> - 2003-09-24 23:09:44
|
William McKee wrote:
> I'm new to Log4perl but am looking forward to using such a well
> architected logging environment!
Thanks - of course this honor goes to Ceki who architected Log4j :).
> I am in the process of inserting
> logging statements into an application that I run in mod_perl. During
> development, I use Apache::Reload to reload any modules which get
> updated.
I see ... in a persistent environment like modperl this will cause
Log::Log4perl->init() to be called twice, which in the current release
will create duped loggers. To alleviate the problem until it gets fixed
(next release), just use
Log::Log4perl->reset();
Log::Log4perl->init(...);
in your application instead of just calling init(). Or, just call init()
once at server startup and not during the reload.
--
-- Mike
Mike Schilli
m...@pe...
|
|
From: Viner, D. <dv...@ya...> - 2003-09-24 23:02:41
|
yup... you're right...
that works great...
thanks
dave
-----Original Message-----
From: Mike Schilli [mailto:msc...@ao...]
Sent: Wednesday, September 24, 2003 3:44 PM
To: Viner, David
Cc: 'log...@li...';
'ma...@ml...'
Subject: RE: [log4perl-devel] use strict and
JavaMap::RollingFileAppender problem
Hmm, I don't think you should use the JavaMap appender in this context.
Those are typically used just for mapping log4j appenders to log4perl,
like in
log4j.appender.FR1=org.apache.log4j.RollingFileAppender
But if you're using a Perl appender anyway, why not use it directly:
#l4p.conf
log4perl.appender.FR1 = Log::Dispatch::FileRotate
This will work fine.
Viner, David wrote:
> The attached patch to Log::Dispatch::FileRotate fixes the problem for
> Log::Log4perl. Mark, as the owner of the FileRotate module, can you
> review
> this patch?
--
-- Mike
Mike Schilli
m...@pe...
|
|
From: Mike S. <msc...@ao...> - 2003-09-24 22:48:02
|
Hmm, I don't think you should use the JavaMap appender in this context.
Those are typically used just for mapping log4j appenders to log4perl,
like in
log4j.appender.FR1=org.apache.log4j.RollingFileAppender
But if you're using a Perl appender anyway, why not use it directly:
#l4p.conf
log4perl.appender.FR1 = Log::Dispatch::FileRotate
This will work fine.
Viner, David wrote:
> The attached patch to Log::Dispatch::FileRotate fixes the problem for
> Log::Log4perl. Mark, as the owner of the FileRotate module, can you
> review
> this patch?
--
-- Mike
Mike Schilli
m...@pe...
|
|
From: William M. <wi...@kn...> - 2003-09-24 22:40:15
|
Hi, I'm new to Log4perl but am looking forward to using such a well architected logging environment! I am in the process of inserting logging statements into an application that I run in mod_perl. During development, I use Apache::Reload to reload any modules which get updated. This technique appears to be causing my logger->info() statements to be reprocessed which is resulting in multiple messages being sent to my log file (one more for each time the module is reloaded). Since I go through many iterations of a module during development, this can quickly become a nuisance. I checked the archives of the list but could not find any similar discussions. Does anyone else use Log4perl in such an environment? Is this the expected behavior? Is there any way I can convince Log4perl not to continue appending messages when a module is reloaded? Thanks! William -- Knowmad Services Inc. http://www.knowmad.com |
|
From: Viner, D. <dv...@ya...> - 2003-09-24 21:51:27
|
After some more digging, I think I've found the problem.
Log::Log4perl::JavaMap::RollingFileAppender is a wrapper around
Log::Dispatch::FileRotate. This module uses the token 'debug' as a flag to
toggle internal debugging statements. I believe that this causes a conflict
with the Log::Log4perl's expections of the 'debug' token in the hash that is
$self.
The attached patch to Log::Dispatch::FileRotate fixes the problem for
Log::Log4perl. Mark, as the owner of the FileRotate module, can you review
this patch?
thanks
dave viner
-----Original Message-----
From: Viner, David [mailto:dv...@ya...]
Sent: Wednesday, September 24, 2003 10:47 AM
To: 'log...@li...'
Subject: [log4perl-devel] use strict and JavaMap::RollingFileAppender
problem
Hi,
I'm trying to use the RollingFileAppender, but I keep getting this
error:
Can't use string ("debug") as a HASH ref while "strict refs" in use at
/home/y/lib/perl5/site_perl/5.6.1/Log/Log4perl/JavaMap/RollingFileAppender.p
m line 12.
My log config file is really simple:
log4perl.logger.test = DEBUG, FR1
log4perl.appender.FR1 =
Log::Log4perl::JavaMap::RollingFileAppender
log4perl.appender.FR1.Threshold = DEBUG
log4perl.appender.FR1.layout = Log::Log4perl::Layout::PatternLayout
log4perl.appender.FR1.layout.ConversionPattern = \
%d %p> %F{1}:%L %M - %m%n
log4perl.appender.FR1.filename = test.log
log4perl.appender.FR1.mode = append
log4perl.appender.FR1.autoflush = 1
log4perl.appender.FR1.size = 2
log4perl.appender.FR1.max = 2
and my script is equally simple:
#!/usr/local/bin/perl -w
use strict;
use Log::Log4perl qw|get_logger|;
use constant LOGGER_NAME => 'test';
Log::Log4perl->init_and_watch('log.conf', 60);
my $logger = get_logger(LOGGER_NAME);
for(my $i=0; $i<100000; $i++)
{
$logger->debug("Message number $i is hello");
}
I'm using version 0.36 of Log::Log4perl and perl 5.6.1.
Am I doing something wrong? Or is this a known problem with a work-around?
thanks
dave viner
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
log4perl-devel mailing list
log...@li...
https://lists.sourceforge.net/lists/listinfo/log4perl-devel
|
|
From: Viner, D. <dv...@ya...> - 2003-09-24 17:49:37
|
Hi,
I'm trying to use the RollingFileAppender, but I keep getting this
error:
Can't use string ("debug") as a HASH ref while "strict refs" in use at
/home/y/lib/perl5/site_perl/5.6.1/Log/Log4perl/JavaMap/RollingFileAppender.p
m line 12.
My log config file is really simple:
log4perl.logger.test = DEBUG, FR1
log4perl.appender.FR1 =
Log::Log4perl::JavaMap::RollingFileAppender
log4perl.appender.FR1.Threshold = DEBUG
log4perl.appender.FR1.layout = Log::Log4perl::Layout::PatternLayout
log4perl.appender.FR1.layout.ConversionPattern = \
%d %p> %F{1}:%L %M - %m%n
log4perl.appender.FR1.filename = test.log
log4perl.appender.FR1.mode = append
log4perl.appender.FR1.autoflush = 1
log4perl.appender.FR1.size = 2
log4perl.appender.FR1.max = 2
and my script is equally simple:
#!/usr/local/bin/perl -w
use strict;
use Log::Log4perl qw|get_logger|;
use constant LOGGER_NAME => 'test';
Log::Log4perl->init_and_watch('log.conf', 60);
my $logger = get_logger(LOGGER_NAME);
for(my $i=0; $i<100000; $i++)
{
$logger->debug("Message number $i is hello");
}
I'm using version 0.36 of Log::Log4perl and perl 5.6.1.
Am I doing something wrong? Or is this a known problem with a work-around?
thanks
dave viner
|
|
From: Mike S. <msc...@ao...> - 2003-09-23 16:21:42
|
Rit...@ub... wrote:
> I have created my own socket appender using Dispatch::Output. I want
> to give the layout inside my appender so that no user can change it.
> I want to set everything from config file except the layout part.
> It gives me error from Config.pm...Layout not specified for appender.
While the configuration file will need to have a layout defined for
every appender, the solution to your problem is to override this layout
in your application:
use Log::Log4perl qw(:easy);
Log::Log4perl->init(\ <<'EOT');
log4perl.category = WARN, Screen
log4perl.appender.Screen = Log::Log4perl::Appender::Screen
log4perl.appender.Screen.layout = \
Log::Log4perl::Layout::PatternLayout
log4perl.appender.Screen.layout.ConversionPattern = %d %F{1} %L> %m %n
EOT
my $appenders = Log::Log4perl->appenders();
my $layout = Log::Log4perl::Layout::PatternLayout->new("%m %m%n");
$appenders->{Screen}->layout($layout);
WARN("test message");
__END__
--
-- Mike
Mike Schilli
m...@pe...
|
|
From: <Rit...@ub...> - 2003-09-23 12:00:30
|
I have created my own socket appender using Dispatch::Output. I want to = give the layout inside my appender so that no user can change it.=20 I want to set everything from config file except the layout part. It gives me error from Config.pm...Layout not specified for appender. How can I do that? Thanks & Regards, Ritu Kohli UBS Investment Bank Tel: +44-(0)20 7567 6806 Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. |
|
From: Brett R. <bre...@ma...> - 2003-09-22 23:22:09
|
USING:
Log4perl 0.37
Perl 5.00503
PROBLEM:
When using a pattern layout with %l, calls to error_die report the error_die line details instead of the calling line details:
EXAMPLE:
# file and format for detailed log
log4perl.appender.fileDetailed = Log::Log4perl::Appender::File
log4perl.appender.fileDetailed.filename = test2_error.log
log4perl.appender.fileDetailed.mode = append
log4perl.appender.fileDetailed.layout = PatternLayout
log4perl.appender.fileDetailed.layout.ConversionPattern\
= >>%-8p %d logger(%c)%n %m%n at %l%n
log4perl.appender.fileDetailed.Filter = includeDebugErrorFatal
code:
eval { bar() };
# check if the eval had a failed response.
if ($@) {
$logger->error_die("bar() died during evaluate:$@");
}
exit 0 ;
sub bar {
$logger->logdie('bar() is not implemented');
}
log file:
>>FATAL 2003/09/23 08:52:52 logger(main)
bar() is not implemented
at main::bar test2.pl (33)
>>ERROR 2003/09/23 08:52:52 logger(main)
bar() died during evaluate:bar() is not implemented at test2.pl line 33
at Log::Log4perl::Logger::error_die /web/home/brann/perllib/Log/Log4perl/Logger.pm (822)
I would expect line in ERROR to be reported in a similar way to the line in FATAL.
(sorry, enbedded bug report / feature request here)
Also, the path seems inconsistant. Error die reports the full path, log die reports just the filename (this is also true for %F). Also, with the DBI appender it reports the full path for all log types, but file apender reports just the filename. It would be nice for it to be standardized. Perhaps %f for the short filename, and %F for the full?
No patching this time. I just avoid the issue. ;)
Happy to provide more detail if you can't reproduce the error.
Brett
--
--
__________________________________________________________
Sign-up for your own personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
http://corp.mail.com/careers
|
|
From: Mike S. <msc...@ao...> - 2003-09-22 05:11:22
|
Brett Rann wrote: > With constants module in perl 5.00503, constants apparently can not be > defined with a leading underscore. Log4perl v0.36 -> v0.37 renamed > DEBUG constant to _INTERNAL_DEBUG: Ah. Good catch! Checked in, will be released with 0.38. > Please continue to support 5.005. :) This looks to be an extrememly > useful module however my works development platform is frozen at 5.00503. Don't worry, as long as we get detailed bug reports like yours, we'll fix everything to ensure compatibility! I guess Kevin's going to look at your other report soon, the DBI appender is his baby :). Thanks! -- -- Mike Mike Schilli m...@pe... |
|
From: Brett R. <bre...@ma...> - 2003-09-22 04:41:53
|
Problem: With constants module in perl 5.00503, constants apparently can not be defined with a leading underscore. Log4perl v0.36 -> v0.37 renamed DEBUG constant to _INTERNAL_DEBUG: ~/.../Log> egrep -r 'use constant _' * Log4perl/Filter/LevelMatch.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/Filter/Boolean.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/Filter/LevelRange.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/Filter/StringMatch.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/Config/Watch.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/Config/DOMConfigurator.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/JavaMap/TestBuffer.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/JavaMap.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/Appender.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/Logger.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/Config.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/Filter.pm:use constant _INTERNAL_DEBUG => 0; Log4perl.pm:use constant _INTERNAL_DEBUG => 1; Example: ~> perl -e 'use constant _FOO => 1 ; print "OK\n"; exit 0;' Can't define "_FOO" as constant (name contains invalid characters or is empty) at -e line 1 BEGIN failed--compilation aborted at -e line 1. ~> perl -e 'use constant FOO => 1 ; print "OK\n"; exit 0;' OK ~> perl -V Summary of my perl5 (5.0 patchlevel 5 subversion 3) <snip> RECOMMEND & PATCH: Sticking to convention of constants starting with capital letter, and renaming _INTERNAL_DEBUG to INTERNAL_DEBUG: The _ does stand out. ~> ~/.../Log> egrep -r 'use constant _?' * Log4perl/Filter/LevelMatch.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/Filter/Boolean.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/Filter/LevelRange.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/Filter/StringMatch.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/Config/Watch.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/Config/DOMConfigurator.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/JavaMap/TestBuffer.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/JavaMap.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/Appender.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/Logger.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/Config.pm:use constant _INTERNAL_DEBUG => 0; Log4perl/Level.pm:use constant ALL_INT => 0; Log4perl/Level.pm:use constant DEBUG_INT => 10000; Log4perl/Level.pm:use constant INFO_INT => 20000; Log4perl/Level.pm:use constant WARN_INT => 30000; Log4perl/Level.pm:use constant ERROR_INT => 40000; Log4perl/Level.pm:use constant FATAL_INT => 50000; Log4perl/Level.pm:use constant OFF_INT => (2 ** 31) - 1; Log4perl/Filter.pm:use constant _INTERNAL_DEBUG => 0; Log4perl.pm:use constant _INTERNAL_DEBUG => 1; *** (i wonder, is _INTERNAL_DEBUG meant to be turned on in Log4perl.pm? I suspect not...) Please continue to support 5.005. :) This looks to be an extrememly useful module however my works development platform is frozen at 5.00503. Brett -- -- __________________________________________________________ Sign-up for your own personalized E-mail at Mail.com http://www.mail.com/?sr=signup CareerBuilder.com has over 400,000 jobs. Be smarter about your job search http://corp.mail.com/careers |
|
From: Brett R. <bre...@ma...> - 2003-09-22 03:06:24
|
Log4perl/Appender/DBI.pm (exists in v0.37)
PROBLEM:
When a database appender is used and preparedStatement is set, Appender/DBI.pm incorrectly warns that bufferSize has been specified when it has not. Happens also if bufferSize is set to 1, 0 or <blank> (guesses at sensible values), but that is reasonable.
ANALASYS:
Incorrect logic for checking if bufferSize has been set:
Pasted from about line 33.
--------------
* $self->{BUFFERSIZE} = $p{bufferSize} || 1;_
if ($p{usePreparedStmt}) {
$self->{sth} = $self->create_statement($p{sql});
** $self->{usePreparedStmt} = 1;
}else{
$self->{layout} = Log::Log4perl::Layout::PatternLayout->new(
{ConversionPattern => {value => $p{sql}}});
}
*** if ($self->{usePreparedStmt} && $self->{BUFFERSIZE}){
warn "Log4perl: you've defined both usePreparedStmt and bufferSize \n".
"in your appender '$p{name}'--\n".
"I'm going to ignore bufferSize and just use a prepared stmt\n";
}
return $self;
}
-------------
The warning at line *** will always print if usePreparedStmt has been set, because, in the || at line *, $self->{BUFFERSIZE} gets defaulted to 1 if it is undefined, zero or otherwise false.
PATCH:
Change *** to read
If ($self->{usePreparedStmt} && $p{bufferSize}) {
Or possibly unset BUFFERSIZE after line **. I have gone with the first change though because it fixes the problem without making other assumptions (that unsetting it will not break countless bits of code elsewhere).
Regards,
Brett
--
--
__________________________________________________________
Sign-up for your own personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
http://corp.mail.com/careers
|
|
From: Mike S. <msc...@ao...> - 2003-09-21 23:36:43
|
Niles wrote: > Each of the appenders will have different minimum/maximum logging > levels. The Syslog-type one will log everything from INFO and above, > the DBI one will only log INFO, and the Email one will log ERROR and > above. Basically, the Syslog one is to capture all information, the > DBI one is to capture performance data, and the Email one is for > failure notification. > > The init file would contain items like > > log4perl.appender.A2.min_level = info > log4perl.appender.A2.max_level = info > log4perl.appender.A3.min_level = error I think what you've done might work, although we do it differently in Log4perl. Your "only INFO and above" cases are typically solved with "appender thresholds" and the "exactly INFO" case is typically done with a levelmatch filter. Here's two FAQs dealing with these tasks: http://log4perl.sourceforge.net/releases/Log-Log4perl/docs/html/Log/Log4perl/FAQ.html#i_want_to_log_error_and_warn_messages_to_different_files!_how_can_i_do_that http://log4perl.sourceforge.net/releases/Log-Log4perl/docs/html/Log/Log4perl/FAQ.html#how_can_i_collect_all_fatal_messages_in_an_extra_log_file > 3. Since the appenders have different purposes, instead of sending the > same message to multiple appenders (which is easy enough), I'd like to > send a hash reference to each appender, and have each appender format > the output in the way that's most appropriate for the appender. The > Syslog logger would create a line-oriented sendmail-type list of > equates, the DBI logger would write performance information to a > database table, and the Email appender would format the information in > a standard, human-readable fashion. Regarding the DBI logger, you might want to look at http://log4perl.sourceforge.net/releases/Log-Log4perl/docs/html/Log/Log4perl/Appender/DBI.html where Kevin has provided a more powerful interface for DBI interactions. In general, if you want the appender to perform some appender-specific filtering before it actually logs the message, just pick an appender which approximately does what you need (something in the Log::Dispatch hierarchy or an appender that comes with Log::Log4perl like Log::Log4perl::Appender::File), use it as a base class for your new appender and override its log() method. Additionally, if the data you want to pass around is of global nature, take a look at the MDC mechanism at http://log4perl.sourceforge.net/releases/Log-Log4perl/docs/html/Log/Log4perl/FAQ.html#how_can_i_include_global_(threadspecific)_data_in_my_log_messages Hope that helps, let us know if you have any more questions ... -- -- Mike Mike Schilli m...@pe... |
|
From: Roland B. <rol...@ff...> - 2003-09-21 14:54:06
|
Hi, I have some questions about defaults: 1) It seems there is no default name for a config file. >From http://jakarta.apache.org/log4j/docs/manual.html: "In case the system property log4j.configuration is not defined, then set the string variable resource to its default value "log4j.properties"." For the Perl port I would have thought that a) an environment variable e.g. $LOG4PERL_CONFIGURATION or $LOG4PERL could be set and/or b) the default name for the config file were $HOME/log4j.properties or maybe log4perl.conf, log4perl.config, ... 2) Is the function easy_init really necessary? Or - at least - could init accept the same parameters? The following syntax seems ok: init($filename); init(\$config_text); init(\%key_value_pairs); init($url); easy_init($ERROR); # where the string contains a number easy_init(\%key_value_pairs); easy_init(\%key_value_pairs_1, \%key_value_pairs_2, ...); If I am switching from "easy" usage to "standard" usage, I have to a) remove ':easy' b) change easy_init to init c) have to supply a config file name I'd like to omit step b) and c) ;-) Summary: - the call of init without parameters should be ok (a default config file should be searched) - importing ':easy' should signal that the user wants "easy" usage - init should accept $DEBUG, ... as parameters (if ":easy" has been imported) Regards Roland -- Roland Bauer http://www.fff.at/contact/ |
|
From: Mike S. <msc...@ao...> - 2003-09-19 20:02:50
|
Kevin Goess wrote: > This is the fix, changing the default appender threshold from DEBUG to > ALL. Any objections? The unit tests pass, is there a threshold > assumption that I'm overlooking that might cause a problem? Good catch, makes perfect sense to set it to 'ALL'. The default appender threshold should let everything pass through. -- -- Mike Mike Schilli m...@pe... |
|
From: Kevin G. <ke...@go...> - 2003-09-19 19:58:20
|
Thanks, Mike. Fix and test case (in t/025CustLevels.t) checked in. Mike Schilli wrote: > Kevin Goess wrote: > > > This is the fix, changing the default appender threshold from DEBUG to > > ALL. Any objections? The unit tests pass, is there a threshold > > assumption that I'm overlooking that might cause a problem? > > Good catch, makes perfect sense to set it to 'ALL'. The default appender > threshold should let everything pass through. > -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
|
From: Niles <nil...@ex...> - 2003-09-19 19:53:24
|
I am trying to set up a system using Log4perl and multiple appenders, and I think I'm making things much more difficult than I need to. Here's what I want to accomplish: 1. Have 3 different appenders: a Log::Dispatch::Syslog-type appender, a Log::Dispatch::DBI-type appender, and a Log::Dispatch::Email-type appender. (I say "type" because these appenders will all need some modifications, which I will explain later). I'd have something like this in my init file: log4perl.logger=INFO,A1,A2,A3 where A1 is the Syslog appender, A2 is the DBI appender, and A3 is the Email appender. 2. Each of the appenders will have different minimum/maximum logging levels. The Syslog-type one will log everything from INFO and above, the DBI one will only log INFO, and the Email one will log ERROR and above. Basically, the Syslog one is to capture all information, the DBI one is to capture performance data, and the Email one is for failure notification. The init file would contain items like log4perl.appender.A2.min_level = infolog4perl.appender.A2.max_level = infolog4perl.appender.A3.min_level = error (If I can't set the min/max to the same value, I'd have the actual appender take care of that, I guess, but that's not my problem at the moment.) 3. Since the appenders have different purposes, instead of sending the same message to multiple appenders (which is easy enough), I'd like to send a hash reference to each appender, and have each appender format the output in the way that's most appropriate for the appender. The Syslog logger would create a line-oriented sendmail-type list of equates, the DBI logger would write performance information to a database table, and the Email appender would format the information in a standard, human-readable fashion. My first thought was to override the logger call so that two arguments are passed: the ordinary message (in case a future appender needs just use the plain vanilla version) and a hash reference. The three appenders I described would use the hash reference to construct their own message as is appropriate. So, I thought the easiest way would be to override some of the methods in the Log::Dispatch hierarchy, namely new() and log(), and I'd be done. Now, I'm having some difficulty because the appenders are firing when they aren't appropriate. The Email appender, in particular (actually, it's the only one I have started on now; I'm using the vanilla Log::Dispatch::Syslog one right now) fires even when the priority is "warn". I should mention here that I'm doing the following in it: use base qw (Log::Dispatch::Output);use Log::Dispatch::Email;use Mail::Sender;I started digging around in the guts of the Log::Dispatch hierarchy, looking at method calls like _should_log(), but then I start thinking that perhaps I'm going in the completely wrong direction here--I might be making things much more difficult than I have to, which wouldn't be the first time. I could probably hack and hack and make things work, but I'm worried that I'll be losing some compatibility and functionality that I'll need later. What I'm hoping to get from this email is some general direction, such as, "Use the Log4perl blah object, override this and that method, and bingo!" or "You're stuck with the Log::Dispatch stuff, and you're stuck with doing it the way you describe it, but here's what you need to do to maintain compatibility." (I noticed the callback functionality in the Log::Dispatch stuff, but I'm thinking that won't work since I want to pass different information into the appenders [the hash reference] in the first place, and I'd rather not construct some sort of formatted string and then break it up and reformat it multiple times.) I'm sorry if this turns out to be more of a Log::Dispatch question than a Log4perl question. Thank you in advance for any suggestions you might have. :-) Ig _______________________________________________ Join Excite! - http://www.excite.com The most personalized portal on the Web! |
|
From: Kevin G. <ke...@go...> - 2003-09-18 19:21:20
|
Ah, it does seem to be a problem, the appender level, later used for the
threshold, defaults to $DEBUG in appender->new(). So the debug2 message
is seen as not meeting the default threshold and is dropped.
This is the fix, changing the default appender threshold from DEBUG to
ALL. Any objections? The unit tests pass, is there a threshold
assumption that I'm overlooking that might cause a problem?
===================================================
diff -u -u -5 -r1.30 Appender.pm
--- lib/Log/Log4perl/Appender.pm 11 Aug 2003 05:18:06 -0000 1.30
+++ lib/Log/Log4perl/Appender.pm 18 Sep 2003 19:18:41 -0000
@@ -76,11 +76,11 @@
my $self = {
appender => $appender,
name => $params{name},
layout => undef,
- level => $DEBUG,
+ level => $ALL,
};
#whether to collapse arrays, etc.
$self->{warp_message} = $params{warp_message};
if($self->{warp_message} and
===================================================
--
Happy Trails . . .
Kevin M. Goess
(and Anne and Frank)
904 Carmel Ave.
Albany, CA 94706
(510) 525-5217
|
|
From: Kevin G. <ke...@go...> - 2003-09-18 18:43:06
|
I was just trying to create a second debug level under the first one and
it seems to be ignored. Can we not create custom levels below DEBUG?
Is this a known problem, or am I doing something wrong?
====begin code=====================================
use Test;
use Log::Log4perl;
Log::Log4perl::Logger::create_custom_level("DEBUG2", "DEBUG");
Log::Log4perl::Logger::create_custom_level("LITEWARN", "WARN");
#so now we have
# WARN
# LITEWARN
# DEBUG
# DEBUG2
my $config = <<EOT;
log4j.category.w = WARN, testbuffer
log4j.category.lw = LITEWARN, testbuffer
log4j.category.d = DEBUG, testbuffer
log4j.category.d2 = DEBUG2, testbuffer
log4j.appender.testbuffer = Log::Log4perl::Appender::TestBuffer
log4j.appender.testbuffer.layout = Log::Log4perl::Layout::SimpleLayout
EOT
Log::Log4perl::init(\$config);
my $w = Log::Log4perl::get_logger('w');
my $lw = Log::Log4perl::get_logger('lw');
my $d = Log::Log4perl::get_logger('d');
my $d2 = Log::Log4perl::get_logger('d2');
$w->warn('warn');
$lw->litewarn('litewarn');
$d->debug('debug');
$d2->debug2('debug2');
my $buffer =
Log::Log4perl::Appender::TestBuffer->by_name("testbuffer")->buffer;
ok($buffer, '/DEBUG2 - debug2/') ;
#appender contains:
# WARN - warn
# LITEWARN - litewarn
# DEBUG - debug
#where is DEBUG2?
BEGIN { plan tests => 1}
====end code=====================================
--
Happy Trails . . .
Kevin M. Goess
(and Anne and Frank)
904 Carmel Ave.
Albany, CA 94706
(510) 525-5217
|
|
From: Reinhold R. <rei...@gm...> - 2003-09-11 16:07:53
|
Hi all,
first of all thanks to Kevin and Mike helping me to solve my
latest problem: change the log output file at runtime. I wrote
a new class, derived form Log::Log4perl::Appender::File and I'm
happy that it works.
Now, my daemon is ready to run. all users using this daemin are able
to configure their loglevel themselves. so I also change the loglevel
at runtime using the functions dec_level() and inc_level().
At the first time, I missed a function for setting the new loglevel
directly. So I wrote the follwing function that does the work for me:
sub set_level ($$) {
my $logger = shift;
my $new_level = shift;
while ($logger->level() != $new_level) {
if ($logger->level() < $new_level) {
$logger->inc_level();
}
else {
$logger->dec_level();
}
}
} #--- set_level
I don't know if there exists a better solution than this. If so, let
me know please.
but incrementing an decrementing loglevel at runtime made my program
run very slow after a short time. I wrote the follwing little program to
test the memory behavior of the above functions:
#!/usr/bin/perl
use strict;
use Log::Log4perl qw(:easy);
use Log::Log4perl qw(:levels);
use Log::Dispatch::Screen;
use Log::Log4perl::Appender;
#-------------------------------------------------------------------
Log::Log4perl->easy_init ($ERROR);
my $logger = get_logger();
while (1) {
$logger->dec_level();
$logger->inc_level();
}
#---------------------------------------------------------------------
I started it and looked at the mem usage of the process. It was increasing
very quickly. Maybe it is a bug, or am I using this functions not correctly
in my test program??
many thanks for your help.
greetings
Reinhold
--
COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
--------------------------------------------------
1. GMX TopMail - Platz 1 und Testsieger!
2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8. e-Post
|
|
From: Reinhold R. <rei...@gm...> - 2003-09-11 16:03:57
|
Hi all,
first of all thanks to Kevin and Mike helping me to solve my
latest problem: change the log output file at runtime. I wrote
a new class, derived form Log::Log4perl::Appender::File and I'm
happy that it works.
Now, my daemon is ready to run. all users using this daemin are able
to configure their loglevel themselves. so I also change the loglevel
at runtime using the functions dec_level() and inc_level().
At the first time, I missed a function for setting the new loglevel
directly. So I wrote the follwing function that does the work for me:
sub set_level ($$) {
my $logger = shift;
my $new_level = shift;
while ($logger->level() != $new_level) {
if ($logger->level() < $new_level) {
$logger->inc_level();
}
else {
$logger->dec_level();
}
}
} #--- set_level
I don't know if there exists a better solution than this. If so, let
me know please.
but incrementing an decrementing loglevel at runtime made my program
run very slow after a short time. I wrote the follwing little program to
test the memory behavior of the above functions:
#!/usr/bin/perl
use strict;
use Log::Log4perl qw(:easy);
use Log::Log4perl qw(:levels);
use Log::Dispatch::Screen;
use Log::Log4perl::Appender;
#-------------------------------------------------------------------
Log::Log4perl->easy_init ($ERROR);
my $logger = get_logger();
while (1) {
$logger->dec_level();
$logger->inc_level();
}
#---------------------------------------------------------------------
I started it and looked at the mem usage of the process. It was increasing
very quickly. Maybe it is a bug, or am I using this functions not correctly
in my test program??
many thanks for your help.
greetings
Reinhold
--
COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
--------------------------------------------------
1. GMX TopMail - Platz 1 und Testsieger!
2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8. e-Post
|