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: <pa...@ae...> - 2010-04-20 23:07:14
|
Hello List,
New here so forgive me if this is something already solved or known.
Basically I have a program that is running multiple threads with
Log4perl as the logging mechanism.
If I simplify away everything, lets say I have a configuration file with
something like this:
log4perl.logger=DEBUG, Logfile
log4perl.appender.Logfile=Log::Log4perl::Appender::File
log4perl.appender.Logfile.utf8 = 1
log4perl.appender.Logfile.filename= out.log
log4perl.appender.Logfile.layout=Log::Log4perl::Layout::PatternLayout
log4perl.appender.Logfile.layout.ConversionPattern=%d{ISO8601} %p %c -
%m%n
log4perl.appender.Logfile.mode = append
log4perl.appender.Logfile.syswrite = 1
Then the non-threaded perl code:
use Log::Log4perl qw(get_logger);
Log::Log4perl->init_and_watch("log.conf", 60);
my $char = "\x{30DE}\x{30A4}\x{30AF}";
foo('Somecategory');
sub foo {
my $cat = shift;
my $log = get_logger($cat);
$log->info("character [$char]");
}
Everything works, because the utf8 flag is set everything is fine.
However, as soon as we start spawning threads...
use threads;
use threads::shared;
use Log::Log4perl qw(get_logger);
Log::Log4perl->init_and_watch("log.conf", 60);
my $char = "\x{30DE}\x{30A4}\x{30AF}";
#my $a = threads->create(\&foo, 'Somecategory');
#$a->join();
foo('Somecategory');
sub foo {
my $cat = shift;
my $log = get_logger($cat);
$log->info("character [$char]");
}
I get "Thread 1 terminated abnormally: Wide character in syswrite at
/usr/lib/perl5/site_perl/5.8.8/Log/Log4perl/Appender/File.pm line 242."
This seems to be a case where the file handle is losing the utf8
property, and so it must be set again on the handle. I'm not sure why
exactly that happens and am still investigating but this seems to fix
it:
Adding to Log4perl/Appender/File.pm on line 242 above the syswrite:
If (defined $self->{utf8}) {
binmode($fh, ":utf8");
}
Note that I have done testing on other file handles and this appears to
affect everything. Possibly I am doing something wrong and need to make
Log4Perl more aware of threads? The get_logger calls within the
subroutine are there to simulate the usage of my program, and are
possibly not the ideal use?
Please let me know, great tool otherwise!
-Pat
|
|
From: Mike S. <m...@pe...> - 2010-04-09 16:11:46
|
On Fri, 9 Apr 2010, Josh803316 wrote: > wn edification....what is the real difference between the filter > method and the sub method or are they basically the same? They're the same, just different notations. -- Mike Mike Schilli m...@pe... |
|
From: Josh803316 <jos...@gm...> - 2010-04-09 06:26:28
|
Thanks, that worked like a charm! Just for my own edification....what is
the real difference between the filter method and the sub method or are they
basically the same?
On Fri, Apr 9, 2010 at 1:20 AM, Mike Schilli <m...@pe...> wrote:
> On Fri, 9 Apr 2010, Josh803316 wrote:
>
> $logger->trace( {filter => \&Data::Dumper::Dumper, value => $name},
>> undef, $TRACE, undef, undef); So my question is, how can I log the
>> value so it looks like $name instead of $VAR1 in the saved log?
>>
>
> You can pass a reference to a subroutine to Log4perl's logging methods:
>
> $logger->trace( sub { Data::Dumper->Dump([$name], ['name']) } );
>
> would do the trick while retaining the time-saving late evaluation.
>
> -- Mike
>
> Mike Schilli
> m...@pe...
>
|
|
From: Mike S. <m...@pe...> - 2010-04-09 06:21:20
|
On Fri, 9 Apr 2010, Josh803316 wrote:
> $logger->trace( {filter => \&Data::Dumper::Dumper, value => $name},
> undef, $TRACE, undef, undef); So my question is, how can I log the
> value so it looks like $name instead of $VAR1 in the saved log?
You can pass a reference to a subroutine to Log4perl's logging methods:
$logger->trace( sub { Data::Dumper->Dump([$name], ['name']) } );
would do the trick while retaining the time-saving late evaluation.
-- Mike
Mike Schilli
m...@pe...
|
|
From: Josh803316 <jos...@gm...> - 2010-04-09 05:48:58
|
I often use Data::Dumper like this:
print Data::Dumepr->Dump([$name],['name']);
# Which will dump with the variable $name = { .... } instead of $VAR1 = {
... }
I use log4perl and Data::Dumper like this (from the log4perl faq)
$logger->trace( {filter => \&Data::Dumper::Dumper, value => $name}, undef,
$TRACE, undef, undef);
So my question is, how can I log the value so it looks like $name instead of
$VAR1 in the saved log?
|
|
From: Mike S. <m...@pe...> - 2010-04-07 16:01:28
|
On Thu, 1 Apr 2010, Rob Retter wrote: > my die message without newline at > /ccrun/perl/3rdparty/lib/Log/Log4perl/Logger.pm line 884 Fixed, will be released with 1.29: http://github.com/mschilli/log4perl/commit/f74c3490268a78a8cc81f96cbcf78c8bf76e374d Thanks again for your report. -- Mike Mike Schilli m...@pe... |
|
From: Mike S. <m...@pe...> - 2010-04-06 14:39:21
|
On Thu, 1 Apr 2010, Rob Retter wrote: > I'm not entirely sure, but I think there may be something wrong with > logdie() and company Yeah, definitely a bug in logdie(), I'll take care of it, thanks for your report! -- Mike Mike Schilli m...@pe... |
|
From: Rob R. <Rob...@cl...> - 2010-04-01 18:00:30
|
I'm not entirely sure, but I think there may be something wrong with
logdie() and company, specifically the manner in which it reports where
the death occurred. I wrote the following little program:
use lib '/ccrun/perl/3rdparty/lib';
use Log::Log4perl;
Log::Log4perl->init(\ qq{
log4perl.category.Bar.Twix = DEBUG, Screen
log4perl.appender.Screen = Log::Log4perl::Appender::Screen
log4perl.appender.Screen.layout = SimpleLayout
});
my $logger = Log::Log4perl::get_logger ();
sub my_sub
{
$logger->logdie ("my die message without newline");
}
my_sub ();
And the output is:
my die message without newline at
/ccrun/perl/3rdparty/lib/Log/Log4perl/Logger.pm line 884
I think it should have outputted my my source file name and line number,
not Logger.pm's. I am using the 1.28 release of Log4perl and running
under Perl 5.8.8.
|
|
From: Mike S. <m...@pe...> - 2010-03-20 04:14:50
|
On Thu, 11 Mar 2010, Mesdaq, Ali wrote:
> I have looked around the documentation but have not seen anything that
> discusses the ability to use Log4perl's convenience functions inside
> of catalyst apps. Namely the shortcuts of TRACE, DEBUG(), INFO(),
Funny, after thinking about this for quite some time now, suddenly,
after talking to the Catalyst folks yesterday, I realized that you can
already do that! :)
See, there's nothing special about $c->log->debug() except that it
obtains a reference to a Log4perl logger (given you're using Log4perl
with Catalyst of course). DEBUG() in :easy mode does exactly the same.
So, just use Log::Log4perl::Catalyst to initialize Log4perl with
Catalyst (check the manpage for that) and then use Log::Log4perl
qw(:easy) for the macros.
I've added it to the documentation:
http://github.com/mschilli/log4perl/commit/aeaf10cca8e8c5ba64bc2783109dc5b345436d91
Enjoy! :)
-- Mike
Mike Schilli
m...@pe...
> WARN(), ERROR(), FATAL(), and ALWAYS. Call me lazy but I am trying to
> avoid doing things like: $c->log->debug("hello"); now that I have been
> spoiled with using DEBUG("hello"); in other places that I use
> Log4perl.
>
> Thanks,
> ------------------------------------------
> Ali Mesdaq (CISSP, GIAC-GREM)
> Sr. Security Researcher
> Websense Security Labs
> http://www.WebsenseSecurityLabs.com
> ------------------------------------------
>
>
>
>
> Protected by Websense Hosted Email Security -- www.websense.com
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> log4perl-devel mailing list
> log...@li...
> https://lists.sourceforge.net/lists/listinfo/log4perl-devel
>
|
|
From: Mike S. <m...@pe...> - 2010-03-12 08:07:58
|
On Thu, 11 Mar 2010, Mesdaq, Ali wrote:
> I am trying to avoid doing things like: $c->log->debug("hello"); now
> that I have been spoiled with using DEBUG("hello"); in other places
> that I use Log4perl.
You know, that's an interesting idea. I'll look into making the macros
work with Catalyst.
-- Mike
Mike Schilli
m...@pe...
|
|
From: Mesdaq, A. <am...@we...> - 2010-03-11 18:55:32
|
I have looked around the documentation but have not seen anything that discusses the ability to use Log4perl's convenience functions inside of catalyst apps. Namely the shortcuts of TRACE, DEBUG(), INFO(), WARN(), ERROR(), FATAL(), and ALWAYS. Call me lazy but I am trying to avoid doing things like: $c->log->debug("hello"); now that I have been spoiled with using DEBUG("hello"); in other places that I use Log4perl.
Thanks,
------------------------------------------
Ali Mesdaq (CISSP, GIAC-GREM)
Sr. Security Researcher
Websense Security Labs
http://www.WebsenseSecurityLabs.com
------------------------------------------
Protected by Websense Hosted Email Security -- www.websense.com
|
|
From: Mike S. <m...@pe...> - 2010-03-11 17:30:57
|
On Thu, 11 Mar 2010, mara raram wrote: > I was so busy profiling that I completely forgot to thank you for that > tip. So, thanks a lot, works brilliant. Glad to hear it worked out! -- Mike Mike Schilli m...@pe... |
|
From: mara r. <mar...@go...> - 2010-03-11 09:57:33
|
Hi Mike, On Sat, Feb 20, 2010 at 3:59 AM, Mike Schilli <m...@pe...> wrote: > On Fri, 19 Feb 2010, mara raram wrote: > >> I just ran into a problem trying to profile one of my perl scripts >> using 'perl -d:Profile'. I cooked it down to this: ---8<--- >> #!/usr/bin/env perl # --- crashes when used with -d:Profile > > it's fairly unlikely that this has anything to do with Log4perl or any > other modules used, most likely it's a bug in the Profiler. I personally > prefer > > http://search.cpan.org/~timb/Devel-NYTProf-3.01/ > > Want to give it a try? I was so busy profiling that I completely forgot to thank you for that tip. So, thanks a lot, works brilliant. Cheers, Mara |
|
From: Mike S. <m...@pe...> - 2010-03-04 07:13:56
|
On Wed, 3 Mar 2010, Todd Rinaldo wrote: > I have a need for multiple processes to append to the same log file. > This seems like it'd be mostly doable if I use the syswrite feature of > the File appender. The problem is that in order for this to work, I > would think that Log4perl would need to re-open the file for write on > each call. It doesn't seem to do that from what I can tell. There's no need to open the file with each call, syswrites will be atomic. -- Mike Mike Schilli m...@pe... |
|
From: Todd R. <to...@cp...> - 2010-03-03 21:13:13
|
I have a need for multiple processes to append to the same log file. This seems like it'd be mostly doable if I use the syswrite feature of the File appender. The problem is that in order for this to work, I would think that Log4perl would need to re-open the file for write on each call. It doesn't seem to do that from what I can tell. Can anyone comment on if what I'm trying to do is possible without a mod to the log4perl code and/or creating my own appender? Thanks, Todd |
|
From: Mike S. <m...@pe...> - 2010-02-24 09:00:02
|
Hi Log4perl enthusiasts,
Log::Log4perl 1.28 has just been released to CPAN. Changes in this
release:
1.28 (2010/02/24)
* (ms) Fixed caller stack with Buffer composite appender
* (ms) Fixed 'local caller_depth' error in various places. First
localizing a variable and then increasing it is incorrect,
as this ignores previous settings. The correct way of
increasing the caller level is: 'local depth = depth + 1'.
* (ms) Added Log::Log4perl::Catalyst for use in Catalyst applications.
Enjoy!
-- Mike
Mike Schilli
m...@pe...
|
|
From: Mike S. <m...@pe...> - 2010-02-20 03:00:00
|
On Fri, 19 Feb 2010, mara raram wrote:
> I just ran into a problem trying to profile one of my perl scripts
> using 'perl -d:Profile'. I cooked it down to this: ---8<---
> #!/usr/bin/env perl # --- crashes when used with -d:Profile
Hi Mara,
it's fairly unlikely that this has anything to do with Log4perl or any
other modules used, most likely it's a bug in the Profiler. I personally
prefer
http://search.cpan.org/~timb/Devel-NYTProf-3.01/
Want to give it a try?
-- Mike
Mike Schilli
m...@pe...
>
> use warnings;
> use strict;
>
> use Log::Dispatch::FileRotate;
> use Log::Log4perl;
>
> # logging behaviour configuration
> my $logconf = q(
> log4perl.logger = DEBUG, FileApp
> log4perl.appender.FileApp = Log::Dispatch::FileRotate
> log4perl.appender.FileApp.filename = test.log
> log4perl.appender.FileApp.layout = PatternLayout
> log4perl.appender.FileApp.mode = append
> log4perl.appender.FileApp.max = 3
> log4perl.appender.FileApp.utf8 = 1
> log4perl.appender.FileApp.layout.ConversionPattern = %d [%p] %c - %m%n
> );
>
> # Initialize logger
> Log::Log4perl->init( \$logconf );
>
> # Obtain a logger instance
> my $logger = Log::Log4perl->get_logger();
>
> $logger->info('alive');
>
> --->8---
>
> Am I doing something wrong here? It runs without problem without the
> '-d:Profile' option. But when I do
>
> $ perl -d:Profile log4perl_test.pl
>
> I get
>
> ---8<---
> The following parameter was passed in the call to
> Log::Dispatch::Output::_basic_init but was not listed in the
> validation options: mode
> at /usr/lib/perl5/site_perl/5.10.0/Devel/Profile.pm line 131
> Log::Dispatch::Output::_basic_init(undef, 'mode', 'append',
> 'name', 'FileApp', 'l4p_post_config_subs', 'ARRAY(0x11d64e0)', 'max',
> 3, ...) called at
> /usr/lib/perl5/site_perl/5.10.0/Log/Dispatch/FileRotate.pm line 32
> Log::Dispatch::FileRotate::new('Log::Dispatch::FileRotate',
> 'min_level', 'debug', 'filename', 'test.log', 'mode', 'append', 'max',
> 3, ...) called at
> /usr/lib/perl5/site_perl/5.10.0/Log/Log4perl/Appender.pm line 77
> Log::Log4perl::Appender::new('Log::Log4perl::Appender',
> 'Log::Dispatch::FileRotate', 'name', 'FileApp',
> 'l4p_post_config_subs', 'ARRAY(0x11d64e0)', 'l4p_depends_on',
> 'ARRAY(0x1325e30)', 'filename', ...) called at
> /usr/lib/perl5/site_perl/5.10.0/Log/Log4perl/Config.pm line 394
> Log::Log4perl::Config::create_appender_instance('HASH(0x133afe8)',
> 'FileApp', 'HASH(0x11d6438)', 'ARRAY(0x11d64e0)', undef) called at
> /usr/lib/perl5/site_perl/5.10.0/Log/Log4perl/Config.pm line 288
> Log::Log4perl::Config::_init('Log::Log4perl::Config',
> 'SCALAR(0x8db190)') called at
> /usr/lib/perl5/site_perl/5.10.0/Log/Log4perl/Config.pm line 36
> Log::Log4perl::Config::init('Log::Log4perl::Config',
> 'SCALAR(0x8db190)') called at
> /usr/lib/perl5/site_perl/5.10.0/Log/Log4perl.pm line 245
> Log::Log4perl::init('Log::Log4perl', 'SCALAR(0x8db190)') called at
> log4perl_test.pl line 23
> --->8---
>
> Any hints?
>
> Regards
> Mara
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> log4perl-devel mailing list
> log...@li...
> https://lists.sourceforge.net/lists/listinfo/log4perl-devel |
|
From: mara r. <mar...@go...> - 2010-02-19 18:35:53
|
Hello,
I just ran into a problem trying to profile one of my perl scripts
using 'perl -d:Profile'.
I cooked it down to this:
---8<---
#!/usr/bin/env perl
# --- crashes when used with -d:Profile
use warnings;
use strict;
use Log::Dispatch::FileRotate;
use Log::Log4perl;
# logging behaviour configuration
my $logconf = q(
log4perl.logger = DEBUG, FileApp
log4perl.appender.FileApp = Log::Dispatch::FileRotate
log4perl.appender.FileApp.filename = test.log
log4perl.appender.FileApp.layout = PatternLayout
log4perl.appender.FileApp.mode = append
log4perl.appender.FileApp.max = 3
log4perl.appender.FileApp.utf8 = 1
log4perl.appender.FileApp.layout.ConversionPattern = %d [%p] %c - %m%n
);
# Initialize logger
Log::Log4perl->init( \$logconf );
# Obtain a logger instance
my $logger = Log::Log4perl->get_logger();
$logger->info('alive');
--->8---
Am I doing something wrong here? It runs without problem without the
'-d:Profile' option. But when I do
$ perl -d:Profile log4perl_test.pl
I get
---8<---
The following parameter was passed in the call to
Log::Dispatch::Output::_basic_init but was not listed in the
validation options: mode
at /usr/lib/perl5/site_perl/5.10.0/Devel/Profile.pm line 131
Log::Dispatch::Output::_basic_init(undef, 'mode', 'append',
'name', 'FileApp', 'l4p_post_config_subs', 'ARRAY(0x11d64e0)', 'max',
3, ...) called at
/usr/lib/perl5/site_perl/5.10.0/Log/Dispatch/FileRotate.pm line 32
Log::Dispatch::FileRotate::new('Log::Dispatch::FileRotate',
'min_level', 'debug', 'filename', 'test.log', 'mode', 'append', 'max',
3, ...) called at
/usr/lib/perl5/site_perl/5.10.0/Log/Log4perl/Appender.pm line 77
Log::Log4perl::Appender::new('Log::Log4perl::Appender',
'Log::Dispatch::FileRotate', 'name', 'FileApp',
'l4p_post_config_subs', 'ARRAY(0x11d64e0)', 'l4p_depends_on',
'ARRAY(0x1325e30)', 'filename', ...) called at
/usr/lib/perl5/site_perl/5.10.0/Log/Log4perl/Config.pm line 394
Log::Log4perl::Config::create_appender_instance('HASH(0x133afe8)',
'FileApp', 'HASH(0x11d6438)', 'ARRAY(0x11d64e0)', undef) called at
/usr/lib/perl5/site_perl/5.10.0/Log/Log4perl/Config.pm line 288
Log::Log4perl::Config::_init('Log::Log4perl::Config',
'SCALAR(0x8db190)') called at
/usr/lib/perl5/site_perl/5.10.0/Log/Log4perl/Config.pm line 36
Log::Log4perl::Config::init('Log::Log4perl::Config',
'SCALAR(0x8db190)') called at
/usr/lib/perl5/site_perl/5.10.0/Log/Log4perl.pm line 245
Log::Log4perl::init('Log::Log4perl', 'SCALAR(0x8db190)') called at
log4perl_test.pl line 23
--->8---
Any hints?
Regards
Mara
|
|
From: Mike S. <m...@pe...> - 2010-02-17 16:50:16
|
On Fri, 12 Feb 2010, Jay wrote:
> log4perl.logger.pnoc=DEBUG, FileAppndr1
> log4perl.appender.FileAppndr1=Log::Log4perl::JavaMap::RollingFileAppender
With the JavaMap appenders, you have to say
log4perl.appender.FileAppndr1=org.apache.log4j.RollingFileAppender
instead of
# wrong
log4perl.appender.FileAppndr1=Log::Log4perl::JavaMap::RollingFileAppender
and it should work fine.
By the way, is there any reason you're not using
Log::Dispatch::FileRotate directly? Here's an example:
http://search.cpan.org/dist/Log-Log4perl/lib/Log/Log4perl/FAQ.pm#How_can_I_roll_over_my_logfiles_automatically_at_midnight?
Hope this helps.
-- Mike
Mike Schilli
m...@pe...
|
|
From: Jay <dif...@ya...> - 2010-02-12 22:26:34
|
Hi
I am using Log-Log4perl-1.27
tst.pl
use Log::Log4perl;
Log::Log4perl::init('log.conf');
$logger = Log::Log4perl->get_logger('tst');
When I configure log.conf as:
log4perl.logger.pnoc=DEBUG, FileAppndr1
log4perl.appender.FileAppndr1=Log::Log4perl::Appender::File
log4perl.appender.FileAppndr1.filename=tst.log
log4perl.appender.FileAppndr1.layout=Log::Log4perl::Layout::PatternLayout
log4perl.appender.FileAppndr1.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p - %m%n
everything works fine.
But when I configure log.conf as:
log4perl.logger.pnoc=DEBUG, FileAppndr1
log4perl.appender.FileAppndr1=Log::Log4perl::JavaMap::RollingFileAppender
log4perl.appender.FileAppndr1.filename=tst.log
log4perl.appender.FileAppndr1.layout=Log::Log4perl::Layout::PatternLayout
log4perl.appender.FileAppndr1.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p - %m%n
it doesn't work. My perl program just crashes without any error message.
1) Could someone let me know, what is going wrong ?
>From man pages I read that log.conf can contain the entires in log4j format.
2) But when I specify the entries in log4j format, it doesn't work. Againt my perl program crashes without any error message. Could someone let me know, if I need to make any changes to tst.pl so that I can use log4j format. in .conf file ?
~Log/Log4perl> ls JavaMap
ConsoleAppender.pm FileAppender.pm JDBCAppender.pm NTEventLogAppender.pm RollingFileAppender.pm SyslogAppender.pm TestBuffer.pm
TIA
|
|
From: Mike S. <m...@pe...> - 2010-02-07 20:45:39
|
On Fri, 29 Jan 2010, Rob Retter wrote:
> But when your application does:
> my $wrapper = $Log::Log4perl::Logger::APPENDER_BY_NAME{'somename'};
> $wrapper->threshold ('INFO');
> what you get is the wrapper object's "level" field set to the... um,
> priority of the 'INFO' level you passed in.
The terminology can be daunting at first, so it helps if you remember
that messages have 'priorities' and loggers have 'levels'. If a message
has a priority higher than the logger's level, the message gets logged
(I'm not going into numerical values of levels/priorities as these are
transparent to the application and hence irrelevant for the purpose of
this discussion.).
Now, appenders have a feature called 'thresholds', which is virtually
identical to a logger's level. If the message priority is higher than
the appender's threshold, the message gets logged.
> But it does leave the actual appender object's "Threshold" field
> unchanged. So if that field were already 'DEBUG', what you get is a
> wrapper saying one thing about level, while it contains an appender
> saying another thing about Threshold.
I'm not sure where this "Threshold" field you are referring to is
located. Do you mean the configuration file? Can you point me to the
code?
-- Mike
Mike Schilli
m...@pe...
|
|
From: Mike S. <m...@pe...> - 2010-02-07 18:46:38
|
Hi Log4perl enthusiasts,
Log::Log4perl 1.27 has just been released to CPAN. The following changes
went into this release:
1.27 (2010/02/07)
* (ms) ***WARNING: This might break backward compatibility
with some wrapper classes.
[RT 52913] Fixed category fetching in
wrapper classes (reported by Martin Evans). Wrapper classes
now need to call Log::Log4perl->wrapper_register to adapt
get_logger() category fetching. Detailed docs under
"Using Log::Log4perl with wrapper functions and classes"
* (ms) Made meta tag compatible with MakeMaker versions < 6.50
(ms) [RT 52083] Fixed manifest glitch from 1.26 (reported by
Lars Thegler).
* (ms) Added note to FAQ on 'no init happened' warnings for API
initializations, as suggested by Malcolm Nooning.
* (ms) Applied patch by Christopher Mckay which sets
Log4perl::Logger::INITIALIZED only if it's fully initialized.
* (ms) Emmanuel Rodriguez suggested changing TestBuffer's reset()
method to leave the logger population alone. Added clear()
to accomodate the need for a single buffer reset.
* (ms) Xavier Caron added %p{1} to allow abbreviated priority
strings in the pattern layout.
* (ms) Redid composite appenders to address problems with incorrect
caller() data. L4p now supports a $cache parameter to be
passed to the log() function, which stores the completely
rendered message and can be passed to log_cached() later on.
Enjoy!
-- Mike
Mike Schilli
m...@pe...
|
|
From: Ming <mi...@gm...> - 2010-02-05 10:04:18
|
I figured it out. Ubuntu has a time problem that I had "fixed" for jruby. Now I finding that solution causes problems of its own. Thanks for the help. On Fri, Feb 5, 2010 at 4:31 AM, Ming <mi...@gm...> wrote: > I see the same erroneous time with 00 seconds running the equivalent > statement in both my perl and python interpreters. > > Something is wrong with my Ubuntu 9.10. Who is responsible for this part > of the operating system? > > -Ming > > > On Fri, Feb 5, 2010 at 2:58 AM, Mike Schilli <m...@pe...> wrote: > >> Interesting, I don't get that with perl 5.10.0 on Linux. What does >> >> perl -le 'print scalar gmtime (1030429942 - 7*3600)' >> >> show on your platform? >> >> It should be >> >> Mon Aug 26 23:32:22 2002 >> >> (that's what I get on Linux) but on your platform, I suspect, it's >> >> Mon Aug 26 23:32:00 2002 >> >> instead. Maybe a bug on a specific platform? Which one are you on? Can >> you try with a later perl version? >> >> -- Mike >> >> Mike Schilli >> m...@pe... >> >> On Thu, 4 Feb 2010, you wrote: >> >> This is perl, v5.10.0 built for x86_64-linux-gnu-thread-multi >> >> t/023Date.t .......... 1/36 >>> # Failed test at t/023Date.t line 67. >>> # got: '0 00 000 0000' >>> # expected: '22 22 022 0022' >>> >>> # Failed test at t/023Date.t line 103. >>> # got: '26 Aug 2002 23:32:00,123' >>> # expected: '26 Aug 2002 23:32:22,123' >>> >>> # Failed test at t/023Date.t line 106. >>> # got: '2002-08-26 23:32:00,123' >>> # expected: '2002-08-26 23:32:22,123' >>> >>> # Failed test at t/023Date.t line 109. >>> # got: '23:32:00,123' >>> # expected: '23:32:22,123' >>> >>> # Failed test at t/023Date.t line 112. >>> # got: '[Mon Aug 26 23:32:00 2002]' >>> # expected: '[Mon Aug 26 23:32:22 2002]' >>> # Looks like you failed 5 tests of 36. >>> t/023Date.t .......... Dubious, test returned 5 (wstat 1280, 0x500) >>> Failed 5/36 subtests >>> >>> TIA >> >> > |
|
From: Ming <mi...@gm...> - 2010-02-05 09:31:49
|
I see the same erroneous time with 00 seconds running the equivalent statement in both my perl and python interpreters. Something is wrong with my Ubuntu 9.10. Who is responsible for this part of the operating system? -Ming On Fri, Feb 5, 2010 at 2:58 AM, Mike Schilli <m...@pe...> wrote: > Interesting, I don't get that with perl 5.10.0 on Linux. What does > > perl -le 'print scalar gmtime (1030429942 - 7*3600)' > > show on your platform? > > It should be > > Mon Aug 26 23:32:22 2002 > > (that's what I get on Linux) but on your platform, I suspect, it's > > Mon Aug 26 23:32:00 2002 > > instead. Maybe a bug on a specific platform? Which one are you on? Can > you try with a later perl version? > > -- Mike > > Mike Schilli > m...@pe... > > On Thu, 4 Feb 2010, you wrote: > > This is perl, v5.10.0 built for x86_64-linux-gnu-thread-multi > > t/023Date.t .......... 1/36 >> # Failed test at t/023Date.t line 67. >> # got: '0 00 000 0000' >> # expected: '22 22 022 0022' >> >> # Failed test at t/023Date.t line 103. >> # got: '26 Aug 2002 23:32:00,123' >> # expected: '26 Aug 2002 23:32:22,123' >> >> # Failed test at t/023Date.t line 106. >> # got: '2002-08-26 23:32:00,123' >> # expected: '2002-08-26 23:32:22,123' >> >> # Failed test at t/023Date.t line 109. >> # got: '23:32:00,123' >> # expected: '23:32:22,123' >> >> # Failed test at t/023Date.t line 112. >> # got: '[Mon Aug 26 23:32:00 2002]' >> # expected: '[Mon Aug 26 23:32:22 2002]' >> # Looks like you failed 5 tests of 36. >> t/023Date.t .......... Dubious, test returned 5 (wstat 1280, 0x500) >> Failed 5/36 subtests >> >> TIA > > |
|
From: Mike S. <m...@pe...> - 2010-02-05 07:58:48
|
Interesting, I don't get that with perl 5.10.0 on Linux. What does
perl -le 'print scalar gmtime (1030429942 - 7*3600)'
show on your platform?
It should be
Mon Aug 26 23:32:22 2002
(that's what I get on Linux) but on your platform, I suspect, it's
Mon Aug 26 23:32:00 2002
instead. Maybe a bug on a specific platform? Which one are you on? Can
you try with a later perl version?
-- Mike
Mike Schilli
m...@pe...
On Thu, 4 Feb 2010, you wrote:
This is perl, v5.10.0 built for x86_64-linux-gnu-thread-multi
> t/023Date.t .......... 1/36
> # Failed test at t/023Date.t line 67.
> # got: '0 00 000 0000'
> # expected: '22 22 022 0022'
>
> # Failed test at t/023Date.t line 103.
> # got: '26 Aug 2002 23:32:00,123'
> # expected: '26 Aug 2002 23:32:22,123'
>
> # Failed test at t/023Date.t line 106.
> # got: '2002-08-26 23:32:00,123'
> # expected: '2002-08-26 23:32:22,123'
>
> # Failed test at t/023Date.t line 109.
> # got: '23:32:00,123'
> # expected: '23:32:22,123'
>
> # Failed test at t/023Date.t line 112.
> # got: '[Mon Aug 26 23:32:00 2002]'
> # expected: '[Mon Aug 26 23:32:22 2002]'
> # Looks like you failed 5 tests of 36.
> t/023Date.t .......... Dubious, test returned 5 (wstat 1280, 0x500)
> Failed 5/36 subtests
>
> TIA |