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: Mike S. <m...@pe...> - 2016-11-15 04:43:30
|
Hi Log4perl enthusiasts, our maintenance release 1.48 just went out with these changes: 1.48 (2016/11/14) * (ms) [rt.cpan.org #117377] Moved PatternLayout's documentation of DateFormat features to DateFormat.pm to avoid duplication and keep the two parts consistent, as suggested by Max Carey. * (ms) [rt.cpan.org #114822] Split two lines with CVS-sensitive $Log.. variables into two parts. * (ms) Semaphore issue fixed in Synchronized (reported by Siarhei Kuchynski and Martin Köhler): https://github.com/mschilli/log4perl/issues/72 * (ms) header_text now works with syswrite (reported by Tom Metro): https://github.com/mschilli/log4perl/issues/73 Enjoy! -- -- Mike Schilli |
From: Mike S. <m...@pe...> - 2016-03-19 04:25:52
|
Dear Log4perl enthusiasts, Log::Log4perl 1.47 has just been released to CPAN. The maintenance release contains a number of fixes for bugs reported on rt.cpan.org: 1.47 (2016/03/17) * (ms) [rt.cpan.org #102647] Slaven Rezic fixed a test case for file permissions * (ms) Fixed synopsis code in Log::Log4perl::Appender::DBI, reported by Chris Collins. * (ms) Added suggestion by Dylan Doxey to test for both MSWin32 and cygwin to detect windows-like systems for which tests need to be skipped. * (ms) [rt.cpan.org #110915] Fixed "Redundant argument in sprintf" warning caused by DateFormat.pm with %d{Z} placeholders, reported by Alexander Hartmaier. * (ms) [rt.cpan.org #110512] Felix Ostmann fixed a broken error message raised when a boolean filter can't be found. * (ms) All hash traversals in Config.pm now done via "sort keys" to make sure we can reliably reproduce potential problems. Enjoy! -- Mike Mike Schilli m...@pe... |
From: Meir G. <me...@gu...> - 2015-03-02 15:57:52
|
Hey folks, Is anybody aware of a WxPerl (Perl's wrappers - http://www.wxperl.it/ - around wxWidgets - http://www.wxwidgets.org/) appender??? In particular, an appender that will be the target of the Wx::Log::SetActiveTarget() method? Best regards, Meir |
From: Mike S. <m...@pe...> - 2014-12-24 17:35:41
|
> I'm trying to log all messages with levels DEBUG through FATAL to > logs/ssb.log, and all messages with levels INFO through FATAL to > logs/user.log Actually, your script works for me: $ cat logs/* 2014/12/24 09:30:23 main.main::(40) DEBUG debug 2014/12/24 09:30:23 main.main::(41) INFO info 2014/12/24 09:30:23 main.main::(42) ERROR error 2014/12/24 09:30:23 main.main::(43) FATAL fatal INFO - info ERROR - error FATAL - fatal when I add my $log = get_logger( "ssb" ); $log->debug( "debug" ); $log->info( "info" ); $log->error( "error" ); $log->fatal( "fatal" ); But I had to first fix the strange encoding: perl -p -i -e 's/\xc2\xa0/ /g' scriptname Is this Windows or why are some spaces in your configuration encoded as "c2a0"? -- Mike Mike Schilli m...@pe... |
From: Mike S. <m...@pe...> - 2014-12-24 16:55:30
|
Somehow this got erroneously erased from the moderator list, reposting. -- -- Mike Mike Schilli m...@pe... James Pittman <jpi...@gm...> To: log...@li... Subject: Stuck on MatchRange Date: Tue, 16 Dec 2014 00:03:23 -0500 Hi, I have the following config file: log4perl.logger.SuperSensorBridge = DEBUG, SsbAppender, UserAppender log4perl.logger.ssb = DEBUG, SsbAppender, UserAppender log4perl.filter.MatchDebug = Log::Log4perl::Filter::LevelRange log4perl.filter.MatchDebug.LevelMin = DEBUG log4perl.filter.MatchDebug.LevelMax = FATAL log4perl.filter.MatchDebug.AcceptOnMatch = true log4perl.filter.MatchInfo = Log::Log4perl::Filter::LevelRange log4perl.filter.MatchInfo.LevelMin = INFO log4perl.filter.MatchInfo.LevelMax = FATAL log4perl.filter.MatchInfo.AcceptOnMatch = true log4perl.appender.SsbAppender = Log::Log4perl::Appender::File log4perl.appender.SsbAppender.filename = logs/ssb.log log4perl.appender.SsbAppender.mode = clobber log4perl.appender.SsbAppender.layout = PatternLayout log4perl.appender.SsbAppender.layout.ConversionPattern = %d %C.%M(%L) %p %m%n log4perl.appender.SsbAppender.Filter = MatchDebug log4perl.appender.UserAppender = Log::Log4perl::Appender::File log4perl.appender.UserAppender.filename = logs/user.log log4perl.appender.UserAppender.mode = clobber log4perl.appender.UserAppender.layout = SimpleLayout log4perl.appender.UserAppender.Filter = MatchInfo I'm trying to log all messages with levels DEBUG through FATAL to logs/ssb.log, and all messages with levels INFO through FATAL to logs/user.log but I'm only getting INFO in user.log, and only DEBUG and INFO in ssb.log. Help? Thanks, Jamie |
From: Mike S. <m...@pe...> - 2014-12-15 07:32:26
|
On Thu, 4 Dec 2014, Christopher Collins wrote: > I have one small suggestion for the synopsis Makes perfect sense, I've added it: https://github.com/mschilli/log4perl/commit/953797d4bf330f34ca2628a7c24629c330d2f5b6 Thanks for your suggestion! -- -- Mike Mike Schilli m...@pe... > > > > > > Add > > Log::Log4perl::init ( \$config ) ; > > > > my $logger = Log::Log4perl->get_logger () ; > > > > above > > > > $logger->warn ($custid, 'big problem!!', $ip_addr); > > > > It tripped me up > > > > > > #!/usr/bin/env perl > > use strict ; > > use warnings ; > > > > use Log::Log4perl; > > use Log::Log4perl::Appender::DBI; > > > > my $config = q{ > > log4j.category = WARN, DBAppndr, SCREEN > > log4j.appender.DBAppndr = > Log::Log4perl::Appender::DBI > > log4j.appender.DBAppndr.datasource = DBI:mysql:APPLOG > > log4j.appender.DBAppndr.username = logger > > log4j.appender.DBAppndr.password = ready > > log4j.appender.DBAppndr.sql = \ > > insert into LOG \ > > (level, script, message) \ > > values (?,?,?) > > log4j.appender.DBAppndr.params.1 = %p > > log4j.appender.DBAppndr.usePreparedStmt = 1 > > #just pass through the array of message items in the log > statement > > log4j.appender.DBAppndr.layout = > Log::Log4perl::Layout::NoopLayout > > log4j.appender.DBAppndr.warp_message = 0 > > #driver attributes support > > log4j.appender.DBAppndr.attrs.f_encoding = utf8 > > log4perl.appender.SCREEN = > Log::Log4perl::Appender::Screen > > log4perl.appender.SCREEN.stderr = 0 > > log4perl.appender.SCREEN.layout = > Log::Log4perl::Layout::PatternLayout > > log4perl.appender.SCREEN.layout.ConversionPattern = %d %p %m %n > > }; > > > > Log::Log4perl::init ( \$config ) ; > > > > my $log = Log::Log4perl->get_logger () ; > > > > $log->warn( $0, 'big problem!!' ); > > > > > > > > cid:391340D9-4168-4ECC-B9D2-999681BA1C55@lan > > Chris Collins > > Programmer Analyst > > Phone: 630-282-0361 > > Mobile: 630-247-6705 > > > > Address: 605 Territorial Dr. Bolingbrook, IL 60440 > > > > www.multipkg.com ?? ? > > > > > > > > > > > > > > > > > > > > > |
From: Christopher C. <Chr...@mu...> - 2014-12-04 19:50:05
|
Mike , Kevin I really like your Log::Log4perl::Appender::DBI ! I have one small suggestion for the synopsis Add Log::Log4perl::init ( \$config ) ; my $logger = Log::Log4perl->get_logger () ; above $logger->warn ($custid, 'big problem!!', $ip_addr); It tripped me up #!/usr/bin/env perl use strict ; use warnings ; use Log::Log4perl; use Log::Log4perl::Appender::DBI; my $config = q{ log4j.category = WARN, DBAppndr, SCREEN log4j.appender.DBAppndr = Log::Log4perl::Appender::DBI log4j.appender.DBAppndr.datasource = DBI:mysql:APPLOG log4j.appender.DBAppndr.username = logger log4j.appender.DBAppndr.password = ready log4j.appender.DBAppndr.sql = \ insert into LOG \ (level, script, message) \ values (?,?,?) log4j.appender.DBAppndr.params.1 = %p log4j.appender.DBAppndr.usePreparedStmt = 1 #just pass through the array of message items in the log statement log4j.appender.DBAppndr.layout = Log::Log4perl::Layout::NoopLayout log4j.appender.DBAppndr.warp_message = 0 #driver attributes support log4j.appender.DBAppndr.attrs.f_encoding = utf8 log4perl.appender.SCREEN = Log::Log4perl::Appender::Screen log4perl.appender.SCREEN.stderr = 0 log4perl.appender.SCREEN.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.SCREEN.layout.ConversionPattern = %d %p %m %n }; Log::Log4perl::init ( \$config ) ; my $log = Log::Log4perl->get_logger () ; $log->warn( $0, 'big problem!!' ); [cid:image001.jpg@01D00FC5.B585E790] Chris Collins Programmer Analyst Phone: 630-282-0361 Mobile: 630-247-6705 Address: 605 Territorial Dr. Bolingbrook, IL 60440 www.multipkg.com<http://www.multipkg.com/> |
From: Mike S. <m...@pe...> - 2014-10-28 05:52:30
|
Hi Log4perl enthusiasts, the Log::Log4perl 1.45 maintenance release was just pushed to CPAN, including the following features: 1.45 (2014/10/25) * (ms) fgeueke provided a pull request for short-circuiting boolean filters: https://github.com/mschilli/log4perl/pull/48 * (ms) [rt.cpan.org #94009] Tim Bunce had requested that the PatternLayout's %m specifier allow for fixed indentation, variable indentation, and at the same time permit the use of the chomp option. Added with tests and docs. * (ms) Gianni Ceccarelli added the log4perl.utcDateTimes config option to select UTC instead of localtime: https://github.com/mschilli/log4perl/pull/53 * (ms) @bokutin fixed Catalyst.pm buffer flush: https://github.com/mschilli/log4perl/pull/51 https://github.com/mschilli/log4perl/issues/54 Enjoy! -- -- Mike Mike Schilli m...@pe... |
From: Bill M. <mo...@ha...> - 2014-09-11 04:14:19
|
On Tue, Sep 9, 2014 at 7:44 PM, Mike Schilli <m...@pe...> wrote: > >> I'm not quite sure I understand the ApacheLog documentation, as "$r" > typically is the request coming into a mod_perl handler, whereas the > docs indicate it's some kind of server object, which the Apache2 docs > denote as "$s". Best to clarify with the Log::Dispatch::ApacheLog folks. It expects an object with a log method (that returns a log object). So, this works: log4perl.appender.Apache.apache= sub { Apache2::ServerUtil->server } But, I need to test more. When logging that way newlines are escaped (replaced with '\n') and printing unicode ends up escaped as well. > > > 3) Do I need to use Log::Log4perl::Appender::Synchronized with Apache? >> In >> > > I'd write to a separate logfile instead, turning the "syswrite" option > on, which ensures atomic writes without overlap. I tested with both a screen appender and logging with L::D::ApacheLog. Long as I wrote < 4K it was always atomic. Anything larger I would get overlap. I assumed I was using syswrite already. I'll test this more, too. Thanks! -- Bill Moseley mo...@ha... |
From: Mike S. <m...@pe...> - 2014-09-10 03:04:55
|
On Sat, 6 Sep 2014, Bill Moseley wrote: > 1) Is there a way in the config to optionally select appenders? Or > would it just be better to have more than one log4perl config file and That'd probably be the most straight-forward and cleanest option, alternatively you can use the L4p API to set up or your config, or even change the appender in an existing configuration. > 2) Perhaps a question for another list, but the ApacheLog appender > wants a "$r", which the docs say is an Apache or Apache::Server > object. Something I'm not quite sure I understand the ApacheLog documentation, as "$r" typically is the request coming into a mod_perl handler, whereas the docs indicate it's some kind of server object, which the Apache2 docs denote as "$s". Best to clarify with the Log::Dispatch::ApacheLog folks. > 3) Do I need to use Log::Log4perl::Appender::Synchronized with Apache? > In I'd write to a separate logfile instead, turning the "syswrite" option on, which ensures atomic writes without overlap. > I assume setting utf8 is specific to the appender, right? The "utf8" option is specific to the screen and file appenders, making sure that Perl toggles the switch so that your utf8 strings get written out as such. -- -- Mike Mike Schilli m...@pe... > In my log4perl config file I have a very simple screen appender. > > log4perl.appender.screenAppender = > Log::Log4perl::Appender::Screen > log4perl.appender.screenAppender.utf8 = 1 > log4perl.appender.screenAppender.layout = > Log::Log4perl::Layout::PatternLayout > log4perl.appender.screenAppender.layout.ConversionPattern \ > = [%d{E MMM dd HH:mm:ss yyyy}] [%p] ....... > > > > Sometimes my Catalyst app runs under mod_perl2 and so I'd like to try using > the Log::Dispatch::ApacheLog[1] appender instead of the Screen appender. > > 1) Is there a way in the config to optionally select appenders? Or would > it just be better to have more than one log4perl config file and select the > file at start (e.g. by specifying which log4perl file to use at startup)? > > 2) Perhaps a question for another list, but the ApacheLog appender wants a > "$r", which the docs say is an Apache or Apache::Server object. Something > like this? > > log4perl.appender.screenAppender = Log::Dispatch::ApacheLog > log4perl.appender.screenAppender.apache = sub { > Apache2::ServerUtil->server } > > > I assume setting utf8 is specific to the appender, right? > > 3) Do I need to use Log::Log4perl::Appender::Synchronized with Apache? In > my testing with the Screen appender messages < 4K are always written to the > logs atomically -- anything larger then I can get mixing of log entries from > different processes. > > Thanks, > > > [1] The reason would be to have a unified format for both app log entires > and any messages Apache generates. > > -- > Bill Moseley > mo...@ha... > > |
From: Alexander H. <ale...@gm...> - 2014-09-07 09:56:48
|
On Sat, Sep 6, 2014 at 9:56 PM, Bill Moseley <mo...@ha...> wrote: > In my log4perl config file I have a very simple screen appender. > > log4perl.appender.screenAppender = Log::Log4perl::Appender::Screen > log4perl.appender.screenAppender.utf8 = 1 > log4perl.appender.screenAppender.layout = > Log::Log4perl::Layout::PatternLayout > log4perl.appender.screenAppender.layout.ConversionPattern \ > = [%d{E MMM dd HH:mm:ss yyyy}] [%p] ....... > > > > Sometimes my Catalyst app runs under mod_perl2 and so I'd like to try > using the Log::Dispatch::ApacheLog[1] appender *instead* of the Screen > appender. > > 1) Is there a way in the config to optionally select appenders? Or would > it just be better to have more than one log4perl config file and select the > file at start (e.g. by specifying which log4perl file to use at startup)? > > 2) Perhaps a question for another list, but the ApacheLog appender wants a > "$r", which the docs say is an Apache or Apache::Server object. > Something like this? > > log4perl.appender.screenAppender = Log::Dispatch::ApacheLog > log4perl.appender.screenAppender.apache = sub { > Apache2::ServerUtil->server } > > > I assume setting utf8 is specific to the appender, right? > > 3) Do I need to use Log::Log4perl::Appender::Synchronized with Apache? > In my testing with the Screen appender messages < 4K are always written to > the logs atomically -- anything larger then I can get mixing of log entries > from different processes. > > Thanks, > > > [1] The reason would be to have a unified format for both app log entires > and any messages Apache generates. > Hi Bill, what I do in our Catalyst apps is to have the l4p config inside the Catalyst::Plugin::ConfigLoader config which is selected through an env var. As I have different Catalyst configs for development, testing and production deployment the l4p config inside is different too. BR Alex > > -- > Bill Moseley > mo...@ha... > > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > |
From: Bill M. <mo...@ha...> - 2014-09-06 20:26:50
|
In my log4perl config file I have a very simple screen appender. log4perl.appender.screenAppender = Log::Log4perl::Appender::Screen log4perl.appender.screenAppender.utf8 = 1 log4perl.appender.screenAppender.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.screenAppender.layout.ConversionPattern \ = [%d{E MMM dd HH:mm:ss yyyy}] [%p] ....... Sometimes my Catalyst app runs under mod_perl2 and so I'd like to try using the Log::Dispatch::ApacheLog[1] appender *instead* of the Screen appender. 1) Is there a way in the config to optionally select appenders? Or would it just be better to have more than one log4perl config file and select the file at start (e.g. by specifying which log4perl file to use at startup)? 2) Perhaps a question for another list, but the ApacheLog appender wants a "$r", which the docs say is an Apache or Apache::Server object. Something like this? log4perl.appender.screenAppender = Log::Dispatch::ApacheLog log4perl.appender.screenAppender.apache = sub { Apache2::ServerUtil->server } I assume setting utf8 is specific to the appender, right? 3) Do I need to use Log::Log4perl::Appender::Synchronized with Apache? In my testing with the Screen appender messages < 4K are always written to the logs atomically -- anything larger then I can get mixing of log entries from different processes. Thanks, [1] The reason would be to have a unified format for both app log entires and any messages Apache generates. -- Bill Moseley mo...@ha... |
From: Mike S. <m...@pe...> - 2014-05-18 03:56:09
|
Hi Log4perl enthusiasts, the Log::Log4perl 1.44 maintenance release has just been pushed to CPAN, changes are: 1.44 (2014/05/17) * Skipped mkpath umask tests on Win32 which doesn't support it properly. * Requiring core module File::Path 2.06_06, which has remove_tree() (fixes test suite for ancient perl-5.6.2). * Brian Wightman fixed temporary file cleanup in the test suite for Win32: https://github.com/mschilli/log4perl/pull/45 Enjoy! -- -- Mike Mike Schilli m...@pe... |
From: Mike S. <m...@pe...> - 2014-05-07 04:34:17
|
On Sat, 3 May 2014, Sonderegger, Markus wrote: > I tried the above cspec.E but I am getting the following error > Argument "srp03443ax.juliusbaer.com" isn't numeric in sprintf at That's quite odd, because the code below works for me with Log::Log4perl 1.42 without any warnings and generates this (expected) output: :MINOR:myhostname:BCOM:AMH: ./t2 Blah Seems like in your example, a hostname is being printed as a numerical string, but I can’t see what this could be caused by based on the code you’ve submitted. Maybe there’s something else going on? use strict; use warnings; use Log::Log4perl qw(:easy); my $conf = q( log4perl.category.Bar.Twix = WARN, SYSLOG log4perl.appender.SYSLOG = Log::Dispatch::Screen log4perl.appender.SYSLOG.Threshold = WARN log4perl.appender.SYSLOG.facility = local2 log4perl.appender.SYSLOG.ident = 'tivoli' log4perl.appender.SYSLOG.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.SYSLOG.layout.cspec.E = sub { return 'MINOR' if $_[3] eq 'WARN' } log4perl.appender.SYSLOG.layout.ConversionPattern=:%E:%H:%X{sx_Appl}:%X{sx_Inst}: %F %m%n log4perl.appender.Logfile.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.Logfile.layout.cspec.E = sub { return $_[3] } log4perl.appender.Logfile.layout.ConversionPattern=:%E: %m%n ); Log::Log4perl::init(\$conf); Log::Log4perl::MDC->put('sx_Appl', 'BCOM'); Log::Log4perl::MDC->put('sx_Inst', 'AMH'); my $logger = get_logger("Bar::Twix"); $logger->warn("Blah”); -- -- Mike Mike Schilli m...@pe... > The Tivoli log file adapter reads a file where its information is > delimited by colons: > > severity, hostname, Application, Instance, Program, Message. > > > > Using a pattern layout I can create this entry as in (actually SYSLOG is writing into Tivoli file) > > > > log4perl.appender.SYSLOG = Log::Dispatch::Syslog > > log4perl.appender.SYSLOG.Threshold = WARN > > log4perl.appender.SYSLOG.facility = local2 > > log4perl.appender.SYSLOG.ident = 'tivoli' > > log4perl.appender.SYSLOG.layout = Log::Log4perl::Layout::PatternLayout > > log4perl.appender.SYSLOG.layout.cspec.E = sub { return 'MINOR' if $_[3] eq 'WARN' } > > log4perl.appender.SYSLOG.layout.ConversionPattern=:%E:%H:%X{sx_Appl}:%X{sx_Inst}: %F %m%n > > > > but I am struggling with mapping Log4Perl severities to Tivoli severities. > > /u01/app/perl/lib/perl5/site_perl/5.16.3/Log/Log4perl/Layout/PatternLayout.pm > line 307. > > Missing argument in sprintf at /u01/app/perl/lib/perl5/site_perl/5.16.3/Log/Log4perl/Layout/PatternLayout.pm line 307. > > > > when executig > > #!/u01/app/perl/bin/perl > > use warnings; > > use strict; > > use Log::Log4perl qw(get_logger); > > > > Log::Log4perl::init( '/u01/app/amh/UserProvisioning/testing.conf' ); > > Log::Log4perl::MDC->put('sx_Appl', 'BCOM'); > > Log::Log4perl::MDC->put('sx_Inst', 'AMH'); > > my $logger = get_logger(""); > > $logger->warn("Testing"); > > > > > > Any help is greatly appreciated. > > Regards > > Markus > > _____________________________________________________________ > > Dr. Markus Sonderegger > > Application Integration > > Bank Julius Baer & Co. Ltd. > > Hohlstrasse 600, P.O. Box, CH-8010 Zurich, Switzerland > > Telephone +41 58 88 77281, Telefax +41 58 88 74851 > > Mobile Phone +41 79 698 09 79 > > www.juliusbaer.com > > > > Julius Baer cares about the environment: Please do not print this e-mail unless you really need to. > > > > > > *****JuliusBaer Disclaimer***** This e-mail is for the intended recipient only and may contain confidential or privileged information. If you have received this > e-mail by mistake, please contact us immediately and completely delete it (and any attachments) and do not forward it or inform any other person of its contents. > If you send us messages by e-mail, we take this as your authorisation to correspond with you by e-mail, however, we reserve the right not to execute orders and > instructions transmitted by e-mail at any time and without further explanation. If you do not wish to receive any further e-mail correspondence please let us know. > E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, amended, corrupted, lost, destroyed, arrive late or > incomplete, or contain viruses. Neither the Julius Baer Group nor the sender accept liability for any errors or omissions in the content of this message which > arise as a result of its e-mail transmission. Please note that all e-mail communications to and from the Julius Baer Group may be monitored. This communication is > for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation > of any transaction. > > |
From: Sonderegger, M. <mar...@ju...> - 2014-05-03 22:44:39
|
The Tivoli log file adapter reads a file where its information is delimited by colons: severity, hostname, Application, Instance, Program, Message. Using a pattern layout I can create this entry as in (actually SYSLOG is writing into Tivoli file) log4perl.appender.SYSLOG = Log::Dispatch::Syslog log4perl.appender.SYSLOG.Threshold = WARN log4perl.appender.SYSLOG.facility = local2 log4perl.appender.SYSLOG.ident = 'tivoli' log4perl.appender.SYSLOG.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.SYSLOG.layout.cspec.E = sub { return 'MINOR' if $_[3] eq 'WARN' } log4perl.appender.SYSLOG.layout.ConversionPattern=:%E:%H:%X{sx_Appl}:%X{sx_Inst}: %F %m%n but I am struggling with mapping Log4Perl severities to Tivoli severities. I tried the above cspec.E but I am getting the following error Argument "srp03443ax.juliusbaer.com" isn't numeric in sprintf at /u01/app/perl/lib/perl5/site_perl/5.16.3/Log/Log4perl/Layout/PatternLayout.pm line 307. Missing argument in sprintf at /u01/app/perl/lib/perl5/site_perl/5.16.3/Log/Log4perl/Layout/PatternLayout.pm line 307. when executig #!/u01/app/perl/bin/perl use warnings; use strict; use Log::Log4perl qw(get_logger); Log::Log4perl::init( '/u01/app/amh/UserProvisioning/testing.conf' ); Log::Log4perl::MDC->put('sx_Appl', 'BCOM'); Log::Log4perl::MDC->put('sx_Inst', 'AMH'); my $logger = get_logger(""); $logger->warn("Testing"); Any help is greatly appreciated. Regards Markus _____________________________________________________________ Dr. Markus Sonderegger Application Integration Bank Julius Baer & Co. Ltd. Hohlstrasse 600, P.O. Box, CH-8010 Zurich, Switzerland Telephone +41 58 88 77281, Telefax +41 58 88 74851 Mobile Phone +41 79 698 09 79 www.juliusbaer.com<http://www.juliusbaer.com> Julius Baer cares about the environment: Please do not print this e-mail unless you really need to. *****JuliusBaer Disclaimer***** This e-mail is for the intended recipient only and may contain confidential or privileged information. If you have received this e-mail by mistake, please contact us immediately and completely delete it (and any attachments) and do not forward it or inform any other person of its contents. If you send us messages by e-mail, we take this as your authorisation to correspond with you by e-mail, however, we reserve the right not to execute orders and instructions transmitted by e-mail at any time and without further explanation. If you do not wish to receive any further e-mail correspondence please let us know. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, amended, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. Neither the Julius Baer Group nor the sender accept liability for any errors or omissions in the content of this message which arise as a result of its e-mail transmission. Please note that all e-mail communications to and from the Julius Baer Group may be monitored. This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. |
From: Mike S. <m...@pe...> - 2014-03-20 22:30:17
|
On Sun, 16 Mar 2014, Sonderegger, Markus wrote: > I noticed that $logger->logcroak("Go to Syslog”) is not seen in syslog > because the FATAL error level is not mapped to one of the > Log::Dispatch::Syslog levels. This is a bug in earlier versions of Sys::Syslog, not Log4perl. Make sure you have a recent installation of Sys::Syslog, the problem got fixed in 0.31: http://cpansearch.perl.org/src/SAPER/Sys-Syslog-0.33/Changes 0.31 -- 2012.08.18 -- Sebastien Aperghis-Tramoni (SAPER) [BUGFIX] Level 'emerg' could not be used since v0.29. Simply get the latest Sys::Syslog (0.33) from CPAN, and you're golden. -- -- Mike Mike Schilli m...@pe... > > Is there a way to circumvent this or do I oversee anything? > > Regards > > Markus > > _____________________________________________________________ > > Dr. Markus Sonderegger > > Application Integration > > Bank Julius Baer & Co. Ltd. > > Hohlstrasse 600, P.O. Box, CH-8010 Zurich, Switzerland > > Telephone +41 58 88 77281, Telefax +41 58 88 74851 > > Mobile Phone +41 79 698 09 79 > > www.juliusbaer.com > > > > Julius Baer cares about the environment: Please do not print this e-mail > unless you really need to. > > > > > > *****JuliusBaer Disclaimer***** This e-mail is for the intended recipient > only and may contain confidential or privileged information. If you have > received this e-mail by mistake, please contact us immediately and > completely delete it (and any attachments) and do not forward it or inform > any other person of its contents. If you send us messages by e-mail, we take > this as your authorisation to correspond with you by e-mail, however, we > reserve the right not to execute orders and instructions transmitted by > e-mail at any time and without further explanation. If you do not wish to > receive any further e-mail correspondence please let us know. E-mail > transmission cannot be guaranteed to be secure or error-free as information > could be intercepted, amended, corrupted, lost, destroyed, arrive late or > incomplete, or contain viruses. Neither the Julius Baer Group nor the sender > accept liability for any errors or omissions in the content of this message > which arise as a result of its e-mail transmission. Please note that all > e-mail communications to and from the Julius Baer Group may be monitored. > This communication is for informational purposes only. It is not intended as > an offer or solicitation for the purchase or sale of any financial > instrument or as an official confirmation of any transaction. > > |
From: Alexander H. <ale...@gm...> - 2014-03-18 21:43:52
|
On Tue, Mar 18, 2014 at 10:22 PM, Claudio Steel <cla...@gm...>wrote: > Yes, I'm pretty sure that is exactly what you mean and very smart idea. > However, I'd like to test small on this and rather than add and setup two > OTHER mods, I would like to just for this instance, statically add the file > path and make sure this thing has at least some life to it. So I changed > the line in my apps config file to > > __PACKAGE__->log(Log::Log4perl::Catalyst->new('/var/www/docttour/log4perl.conf')); > instead of the relative path and its still goes boom. > > > On Tue, Mar 18, 2014 at 8:58 AM, claudio.steel.us < > cla...@gm...> wrote: > >> ok im very new to all of this so im a bit lost in what your explanation >> is. Can I assume you mean that I need to declare the entire (absolute) file >> path? secondly, this would break the app if I had it on a VN so i should >> use the file::shardir thing? >> >> >> >> >> Sent from my Samsung Galaxy Note™, an AT&T LTE smartphone >> >> ok im very new to all of this so im a bit lost in what your explanation >> is. Can I assume you mean that I need to declare the entire (absolute) file >> path? secondly, this would break the app if I had it on a VN so i should >> use the file::shardir thing? >> >> >> >> >> Sent from my Samsung Galaxy Note™, an AT&T LTE smartphone >> Alexander Hartmaier <ale...@gm...> wrote: >> On Tue, Mar 18, 2014 at 7:59 AM, Claudio Steel < >> cla...@gm...> wrote: >> >>> Ok I have read both of these but I'm a little fuzzy on what I did wrong >>> since it seems so straight forward. >>> 1. Have it installed and added to the makefile >>> 2. In my apps 'myapp.pm' I added >>> use Log::Log4perl::Catalyst; >>> and ... >>> __PACKAGE__->log(Log::Log4perl::Catalyst->new('log4perl.conf')); >>> 3. I made a file chmod to 775 in the root directory of the app called >>> log4perl.conf. >>> 4. In the config file i added the following: >>> #log4perl.category= WARN, Logfile >>> log4perl.appender.LOGFILE=Log::Log4perl::Appender::File >>> log4perl.appender.Logfile.filename = /log/debug.log >>> 5. I made a directory, chmod to 775 recursive, in the root directory, >>> 'log/debug.log' >>> >> The Catalyst application's root directory or /? In case of /log/debug.log check the file permissions. > >>> So, unless I comment line 1 of the config I get a 502 error. Once >>> commented the app restarts but doesn't log anything. Any ideas? >>> >> http 502? That's 'bad gateway' and normally only happens behind for example a fastcgi proxy. >> You didn't specify the absolute path of log4perl.conf and you can't rely >> on the current directory. >> Use File::ShareDir of what I suggested previously. >> >> >>> >>> On Mon, Mar 17, 2014 at 9:38 AM, Alexander Hartmaier < >>> ale...@gm...> wrote: >>> >>>> On Mon, Mar 17, 2014 at 6:51 AM, Mike Schilli <m...@pe...>wrote: >>>> >>>>> On Fri, 14 Mar 2014, Claudio Steel wrote: >>>>> >>>>> > I have a new catalyst app and i think your module is exactly what I >>>>> need. However, I'm not >>>>> > able to find where I can set the file path that I want the log to be >>>>> written to. Any advice >>>>> > you have is appreciated. >>>>> >>>>> Check out >>>>> >>>>> >>>>> http://search.cpan.org/~mschilli/Log-Log4perl-1.42/lib/Log/Log4perl/Catalyst.pm >>>>> >>>>> which says that you can provide a configuration file like >>>>> >>>>> __PACKAGE__->log(Log::Log4perl::Catalyst->new('l4p.conf')); >>>>> >>>>> and in your configuration file you can specify a file appender with >>>>> a user-defined path: >>>>> >>>>> # l4p.conf >>>>> log4perl.category = WARN, Logfile >>>>> >>>> I'm not sure if you can assign a log level and appender directory to category, the Log4perl docs only show log4perl.rootLogger = and log4perl.category.Foo.Bar = examples. If all this still doesn't help try to get it working in a simple script without Catalyst. > log4perl.appender.Logfile = Log::Log4perl::Appender::File >>>>> log4perl.appender.Logfile.filename = /foo/bar/test.log >>>>> log4perl.appender.Logfile.layout = >>>>> Log::Log4perl::Layout::PatternLayout >>>>> log4perl.appender.Logfile.layout.ConversionPattern = %d %F{1} >>>>> %L> %m %n >>>>> >>>>> Hope this helps! >>>>> >>>>> -- >>>>> -- Mike >>>> >>>> That's how we do it in our Catalyst apps: >>>> >>>> In the Catalyst app class: >>>> >>>> =item finalize_config >>>> >>>> Initializes the logger after the config file merging and loading is >>>> done. >>>> >>>> =cut >>>> >>>> sub finalize_config { >>>> my $class = shift; >>>> $class->next::method(@_); >>>> $class->log(Log::Log4perl::Catalyst->new($class->config->{log})); >>>> } >>>> >>>> That way we can configure the logging in the Catalyst config file(s) >>>> loaded by Plugin::ConfigLoader with merging and not have a separate one >>>> just for logging. >>>> >>>> Best regards, Alex >>>> >>>> >>>>> Mike Schilli >>>>> m...@pe... >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Learn Graph Databases - Download FREE O'Reilly Book >>>>> "Graph Databases" is the definitive new guide to graph databases and >>>>> their >>>>> applications. Written by three acclaimed leaders in the field, >>>>> this first edition is now available. Download your free book today! >>>>> http://p.sf.net/sfu/13534_NeoTech >>>>> _______________________________________________ >>>>> log4perl-devel mailing list >>>>> log...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/log4perl-devel >>>>> >>>> >>>> >>> >>> >>> -- >>> -Claudio Steel >>> >> >> >> On Tue, Mar 18, 2014 at 7:59 AM, Claudio Steel < >> cla...@gm...> wrote: >> Ok I have read both of these but I'm a little fuzzy on what I did wrong >> since it seems so straight forward. >> 1. Have it installed and added to the makefile >> 2. In my apps 'myapp.pm' I added >> use Log::Log4perl::Catalyst; >> and ... >> __PACKAGE__->log(Log::Log4perl::Catalyst->new('log4perl.conf')); >> 3. I made a file chmod to 775 in the root directory of the app called >> log4perl.conf. >> 4. In the config file i added the following: >> #log4perl.category= WARN, Logfile >> log4perl.appender.LOGFILE=Log::Log4perl::Appender::File >> log4perl.appender.Logfile.filename = /log/debug.log >> 5. I made a directory, chmod to 775 recursive, in the root directory, >> 'log/debug.log' >> >> So, unless I comment line 1 of the config I get a 502 error. Once >> commented the app restarts but doesn't log anything. Any ideas? >> >> You didn't specify the absolute path of log4perl.conf and you can't rely >> on the current directory. >> Use File::ShareDir of what I suggested previously. >> >> >> >> On Mon, Mar 17, 2014 at 9:38 AM, Alexander Hartmaier < >> ale...@gm...> wrote: >> On Mon, Mar 17, 2014 at 6:51 AM, Mike Schilli <m...@pe...> wrote: >> On Fri, 14 Mar 2014, Claudio Steel wrote: >> >> > I have a new catalyst app and i think your module is exactly what I >> need. However, I'm not >> > able to find where I can set the file path that I want the log to be >> written to. Any advice >> > you have is appreciated. >> >> Check out >> >> >> http://search.cpan.org/~mschilli/Log-Log4perl-1.42/lib/Log/Log4perl/Catalyst.pm >> >> which says that you can provide a configuration file like >> >> __PACKAGE__->log(Log::Log4perl::Catalyst->new('l4p.conf')); >> >> and in your configuration file you can specify a file appender with >> a user-defined path: >> >> # l4p.conf >> log4perl.category = WARN, Logfile >> log4perl.appender.Logfile = Log::Log4perl::Appender::File >> log4perl.appender.Logfile.filename = /foo/bar/test.log >> log4perl.appender.Logfile.layout = >> Log::Log4perl::Layout::PatternLayout >> log4perl.appender.Logfile.layout.ConversionPattern = %d %F{1} >> %L> %m %n >> >> Hope this helps! >> >> -- >> -- Mike >> That's how we do it in our Catalyst apps: >> >> In the Catalyst app class: >> >> =item finalize_config >> >> Initializes the logger after the config file merging and loading is done. >> >> =cut >> >> sub finalize_config { >> my $class = shift; >> $class->next::method(@_); >> $class->log(Log::Log4perl::Catalyst->new($class->config->{log})); >> } >> >> That way we can configure the logging in the Catalyst config file(s) >> loaded by Plugin::ConfigLoader with merging and not have a separate one >> just for logging. >> >> Best regards, Alex >> >> >> Mike Schilli >> m...@pe... >> >> >> ------------------------------------------------------------------------------ >> Learn Graph Databases - Download FREE O'Reilly Book >> "Graph Databases" is the definitive new guide to graph databases and their >> applications. Written by three acclaimed leaders in the field, >> this first edition is now available. Download your free book today! >> http://p.sf.net/sfu/13534_NeoTech >> _______________________________________________ >> log4perl-devel mailing list >> log...@li... >> https://lists.sourceforge.net/lists/listinfo/log4perl-devel >> >> >> >> >> -- >> -Claudio Steel >> >> >> > > > -- > -Claudio Steel > |
From: Alexander H. <ale...@gm...> - 2014-03-18 12:39:28
|
On Tue, Mar 18, 2014 at 7:59 AM, Claudio Steel <cla...@gm...>wrote: > Ok I have read both of these but I'm a little fuzzy on what I did wrong > since it seems so straight forward. > 1. Have it installed and added to the makefile > 2. In my apps 'myapp.pm' I added > use Log::Log4perl::Catalyst; > and ... > __PACKAGE__->log(Log::Log4perl::Catalyst->new('log4perl.conf')); > 3. I made a file chmod to 775 in the root directory of the app called > log4perl.conf. > 4. In the config file i added the following: > #log4perl.category= WARN, Logfile > log4perl.appender.LOGFILE=Log::Log4perl::Appender::File > log4perl.appender.Logfile.filename = /log/debug.log > 5. I made a directory, chmod to 775 recursive, in the root directory, > 'log/debug.log' > > So, unless I comment line 1 of the config I get a 502 error. Once > commented the app restarts but doesn't log anything. Any ideas? > You didn't specify the absolute path of log4perl.conf and you can't rely on the current directory. Use File::ShareDir of what I suggested previously. > > On Mon, Mar 17, 2014 at 9:38 AM, Alexander Hartmaier < > ale...@gm...> wrote: > >> On Mon, Mar 17, 2014 at 6:51 AM, Mike Schilli <m...@pe...> wrote: >> >>> On Fri, 14 Mar 2014, Claudio Steel wrote: >>> >>> > I have a new catalyst app and i think your module is exactly what I >>> need. However, I'm not >>> > able to find where I can set the file path that I want the log to be >>> written to. Any advice >>> > you have is appreciated. >>> >>> Check out >>> >>> >>> http://search.cpan.org/~mschilli/Log-Log4perl-1.42/lib/Log/Log4perl/Catalyst.pm >>> >>> which says that you can provide a configuration file like >>> >>> __PACKAGE__->log(Log::Log4perl::Catalyst->new('l4p.conf')); >>> >>> and in your configuration file you can specify a file appender with >>> a user-defined path: >>> >>> # l4p.conf >>> log4perl.category = WARN, Logfile >>> log4perl.appender.Logfile = Log::Log4perl::Appender::File >>> log4perl.appender.Logfile.filename = /foo/bar/test.log >>> log4perl.appender.Logfile.layout = >>> Log::Log4perl::Layout::PatternLayout >>> log4perl.appender.Logfile.layout.ConversionPattern = %d %F{1} >>> %L> %m %n >>> >>> Hope this helps! >>> >>> -- >>> -- Mike >> >> That's how we do it in our Catalyst apps: >> >> In the Catalyst app class: >> >> =item finalize_config >> >> Initializes the logger after the config file merging and loading is done. >> >> =cut >> >> sub finalize_config { >> my $class = shift; >> $class->next::method(@_); >> $class->log(Log::Log4perl::Catalyst->new($class->config->{log})); >> } >> >> That way we can configure the logging in the Catalyst config file(s) >> loaded by Plugin::ConfigLoader with merging and not have a separate one >> just for logging. >> >> Best regards, Alex >> >> >>> Mike Schilli >>> m...@pe... >>> >>> >>> ------------------------------------------------------------------------------ >>> Learn Graph Databases - Download FREE O'Reilly Book >>> "Graph Databases" is the definitive new guide to graph databases and >>> their >>> applications. Written by three acclaimed leaders in the field, >>> this first edition is now available. Download your free book today! >>> http://p.sf.net/sfu/13534_NeoTech >>> _______________________________________________ >>> log4perl-devel mailing list >>> log...@li... >>> https://lists.sourceforge.net/lists/listinfo/log4perl-devel >>> >> >> > > > -- > -Claudio Steel > |
From: Claudio S. <cla...@gm...> - 2014-03-18 06:59:10
|
Ok I have read both of these but I'm a little fuzzy on what I did wrong since it seems so straight forward. 1. Have it installed and added to the makefile 2. In my apps 'myapp.pm' I added use Log::Log4perl::Catalyst; and ... __PACKAGE__->log(Log::Log4perl::Catalyst->new('log4perl.conf')); 3. I made a file chmod to 775 in the root directory of the app called log4perl.conf. 4. In the config file i added the following: #log4perl.category= WARN, Logfile log4perl.appender.LOGFILE=Log::Log4perl::Appender::File log4perl.appender.Logfile.filename = /log/debug.log 5. I made a directory, chmod to 775 recursive, in the root directory, 'log/debug.log' So, unless I comment line 1 of the config I get a 502 error. Once commented the app restarts but doesn't log anything. Any ideas? On Mon, Mar 17, 2014 at 9:38 AM, Alexander Hartmaier < ale...@gm...> wrote: > On Mon, Mar 17, 2014 at 6:51 AM, Mike Schilli <m...@pe...> wrote: > >> On Fri, 14 Mar 2014, Claudio Steel wrote: >> >> > I have a new catalyst app and i think your module is exactly what I >> need. However, I'm not >> > able to find where I can set the file path that I want the log to be >> written to. Any advice >> > you have is appreciated. >> >> Check out >> >> >> http://search.cpan.org/~mschilli/Log-Log4perl-1.42/lib/Log/Log4perl/Catalyst.pm >> >> which says that you can provide a configuration file like >> >> __PACKAGE__->log(Log::Log4perl::Catalyst->new('l4p.conf')); >> >> and in your configuration file you can specify a file appender with >> a user-defined path: >> >> # l4p.conf >> log4perl.category = WARN, Logfile >> log4perl.appender.Logfile = Log::Log4perl::Appender::File >> log4perl.appender.Logfile.filename = /foo/bar/test.log >> log4perl.appender.Logfile.layout = >> Log::Log4perl::Layout::PatternLayout >> log4perl.appender.Logfile.layout.ConversionPattern = %d %F{1} >> %L> %m %n >> >> Hope this helps! >> >> -- >> -- Mike > > That's how we do it in our Catalyst apps: > > In the Catalyst app class: > > =item finalize_config > > Initializes the logger after the config file merging and loading is done. > > =cut > > sub finalize_config { > my $class = shift; > $class->next::method(@_); > $class->log(Log::Log4perl::Catalyst->new($class->config->{log})); > } > > That way we can configure the logging in the Catalyst config file(s) > loaded by Plugin::ConfigLoader with merging and not have a separate one > just for logging. > > Best regards, Alex > > >> Mike Schilli >> m...@pe... >> >> >> ------------------------------------------------------------------------------ >> Learn Graph Databases - Download FREE O'Reilly Book >> "Graph Databases" is the definitive new guide to graph databases and their >> applications. Written by three acclaimed leaders in the field, >> this first edition is now available. Download your free book today! >> http://p.sf.net/sfu/13534_NeoTech >> _______________________________________________ >> log4perl-devel mailing list >> log...@li... >> https://lists.sourceforge.net/lists/listinfo/log4perl-devel >> > > -- -Claudio Steel |
From: Alexander H. <ale...@gm...> - 2014-03-17 13:39:00
|
On Mon, Mar 17, 2014 at 6:51 AM, Mike Schilli <m...@pe...> wrote: > On Fri, 14 Mar 2014, Claudio Steel wrote: > > > I have a new catalyst app and i think your module is exactly what I > need. However, I'm not > > able to find where I can set the file path that I want the log to be > written to. Any advice > > you have is appreciated. > > Check out > > > http://search.cpan.org/~mschilli/Log-Log4perl-1.42/lib/Log/Log4perl/Catalyst.pm > > which says that you can provide a configuration file like > > __PACKAGE__->log(Log::Log4perl::Catalyst->new('l4p.conf')); > > and in your configuration file you can specify a file appender with > a user-defined path: > > # l4p.conf > log4perl.category = WARN, Logfile > log4perl.appender.Logfile = Log::Log4perl::Appender::File > log4perl.appender.Logfile.filename = /foo/bar/test.log > log4perl.appender.Logfile.layout = > Log::Log4perl::Layout::PatternLayout > log4perl.appender.Logfile.layout.ConversionPattern = %d %F{1} %L> > %m %n > > Hope this helps! > > -- > -- Mike That's how we do it in our Catalyst apps: In the Catalyst app class: =item finalize_config Initializes the logger after the config file merging and loading is done. =cut sub finalize_config { my $class = shift; $class->next::method(@_); $class->log(Log::Log4perl::Catalyst->new($class->config->{log})); } That way we can configure the logging in the Catalyst config file(s) loaded by Plugin::ConfigLoader with merging and not have a separate one just for logging. Best regards, Alex > Mike Schilli > m...@pe... > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/13534_NeoTech > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |
From: Mike S. <m...@pe...> - 2014-03-17 05:51:38
|
On Fri, 14 Mar 2014, Claudio Steel wrote: > I have a new catalyst app and i think your module is exactly what I need. However, I'm not > able to find where I can set the file path that I want the log to be written to. Any advice > you have is appreciated. Check out http://search.cpan.org/~mschilli/Log-Log4perl-1.42/lib/Log/Log4perl/Catalyst.pm which says that you can provide a configuration file like __PACKAGE__->log(Log::Log4perl::Catalyst->new('l4p.conf')); and in your configuration file you can specify a file appender with a user-defined path: # l4p.conf log4perl.category = WARN, Logfile log4perl.appender.Logfile = Log::Log4perl::Appender::File log4perl.appender.Logfile.filename = /foo/bar/test.log log4perl.appender.Logfile.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.Logfile.layout.ConversionPattern = %d %F{1} %L> %m %n Hope this helps! -- -- Mike Mike Schilli m...@pe... |
From: Mike S. <m...@pe...> - 2014-03-17 05:41:35
|
Hi Log4perl enthusiasts, the maintenance release Log::Log4perl 1.43 has just been pushed to CPAN with the following changes: 1.43 (2014/03/16) * (ms) Added %m{indent} to indent multi-line messages according to the PatternLayout (inspired by Wolfgang Pecho) * (ms) [rt.cpan.org #84818] Deven T. Corzine suggested adding a conditional use Win32 on Win32 platform to fix a chicken-and-egg problem with the resurrector. * (ms) Brian Wightman fixed Win32 log file cleanup in test suite https://github.com/mschilli/log4perl/pull/39. New FAQ entry on Win32 log file cleanup. Enjoy! -- -- Mike Mike Schilli m...@pe... |
From: Sonderegger, M. <mar...@ju...> - 2014-03-16 18:45:37
|
I noticed that $logger->logcroak("Go to Syslog") is not seen in syslog because the FATAL error level is not mapped to one of the Log::Dispatch::Syslog levels. Is there a way to circumvent this or do I oversee anything? Regards Markus _____________________________________________________________ Dr. Markus Sonderegger Application Integration Bank Julius Baer & Co. Ltd. Hohlstrasse 600, P.O. Box, CH-8010 Zurich, Switzerland Telephone +41 58 88 77281, Telefax +41 58 88 74851 Mobile Phone +41 79 698 09 79 www.juliusbaer.com<http://www.juliusbaer.com> Julius Baer cares about the environment: Please do not print this e-mail unless you really need to. *****JuliusBaer Disclaimer***** This e-mail is for the intended recipient only and may contain confidential or privileged information. If you have received this e-mail by mistake, please contact us immediately and completely delete it (and any attachments) and do not forward it or inform any other person of its contents. If you send us messages by e-mail, we take this as your authorisation to correspond with you by e-mail, however, we reserve the right not to execute orders and instructions transmitted by e-mail at any time and without further explanation. If you do not wish to receive any further e-mail correspondence please let us know. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, amended, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. Neither the Julius Baer Group nor the sender accept liability for any errors or omissions in the content of this message which arise as a result of its e-mail transmission. Please note that all e-mail communications to and from the Julius Baer Group may be monitored. This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. |
From: Claudio S. <cla...@gm...> - 2014-03-14 23:02:38
|
I have a new catalyst app and i think your module is exactly what I need. However, I'm not able to find where I can set the file path that I want the log to be written to. Any advice you have is appreciated. -- -Claudio Steel |
From: Mike S. <m...@pe...> - 2014-03-01 01:00:07
|
On Fri, 28 Feb 2014, Dave Pointon wrote: > whilst developing a bespoke package that uses L4P indirectly (it > 'use's a package that 'use's a package to try and subclass L4P), I was > seeing a carp message that pointed to the 'use' statement Actually, the register_wrapper() call should take care of that problem: http://search.cpan.org/dist/Log-Log4perl/lib/Log/Log4perl.pm#Using_Log::Log4perl_with_wrapper_functions_and_classes If not, do you have a short code example to illustrate the problem? > My enhancement would be to select e.g. via an environment or package > variable, whether carp or cluck is used to generate any warnings in > order to facilitate problem resolution. That'd be a nice addition to Carp.pm :). -- -- Mike Mike Schilli m...@pe... |