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...> - 2007-08-07 07:03:24
|
On Mon, 6 Aug 2007, H. Meyer wrote: > I've just encountered very frequent segmentation faults when trying to > use Log4Perl in a perl web application running inside of apache 1.3.37 > and mod_perl 1.29. I am using perl 5.8.8 and the latest Log4Perl > version from CPAN. Core dumps are unrelated to CPAN modules using plain Perl like Log4perl. If a core dump happens, the Perl interpreter perl crashes, which it shouldn't do if plain Perl is used (and not compiled .xs code). Can you verify where the problem happens? I've recently written an article that shows how to track this down: http://www.linux-magazin.de/heft_abo/ausgaben/2007/01/getriebeschaden (In German only, English version still embargoed). -- Mike Mike Schilli m...@pe... > > Have any problems with such a setup been reported before? (I wasn't able > to find anything in the bug tracker or the mailing list archive) > > Greetings > H. Meyer > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |
From: H. M. <log...@sb...> - 2007-08-05 22:36:41
|
Hi, I've just encountered very frequent segmentation faults when trying to use Log4Perl in a perl web application running inside of apache 1.3.37 and mod_perl 1.29. I am using perl 5.8.8 and the latest Log4Perl version from CPAN. Have any problems with such a setup been reported before? (I wasn't able to find anything in the bug tracker or the mailing list archive) Greetings H. Meyer |
From: Matthew S. <ms...@is...> - 2007-08-01 16:59:58
|
While trying to debug a problem when logging to a MySQL database with Log4perl::Appender::DBI. The logic would just fail saying : Uncaught exception from user code: Log4perl: DBI appender failed to reconnect to database after 3 attempts at ./CSV_gen_sync.pl line 385 at /usr/lib/perl5/site_perl/5.8.8/Log/Log4perl/Appender/DBI.pm line 145 Log::Log4perl::Appender::DBI::query_execute('Log::Log4perl::Appender::DBI=HASH(0x9ea8bd4)', 'DBI::st=HASH(0xa041400)', 'INFO', '2007/08/01 12:19:57', 'publish_files returned an exit_status of 0') called at /usr/lib/perl5/site_perl/5.8.8/Log/Log4perl/Appender/DBI.pm line 112 Log::Log4perl::Appender::DBI::log('Log::Log4perl::Appender::DBI=HASH(0x9ea8bd4)', 'level', 1, 'name', 'DB', 'message', 'ARRAY(0xa03f93c)', 'log4p_category', 'LogFile', ...) called at /usr/lib/perl5/site_perl/5.8.8/Log/Log4perl/Appender.pm line 189 Log::Log4perl::Appender::log('Log::Log4perl::Appender=HASH(0x9e96f20)', 'HASH(0xa03f9cc)', 'LogFile', 'INFO') called at (eval 52) line 41 Log::Log4perl::Logger::__ANON__('Log::Log4perl::Logger=HASH(0x9ad313c)', 'publish_files returned an exit_status of 0') called at /usr/lib/perl5/site_perl/5.8.8/Log/Log4perl/Logger.pm line 771 Log::Log4perl::Logger::__ANON__('Log::Log4perl::Logger=HASH(0x9ad313c)', 'publish_files returned an exit_status of 0') called at ./CSV_gen_sync.pl line 385 msoffen:msoffen:/usr0/html_files_www/smd/operations_reports/scripts I added an explicit print of the $DBI::errstr to the loop and got this: DBI::errstr: Duplicate entry 'INFO-2007/08/01 12:19:57' for key 1 It appears that it doesn't handle when a "real" DB error occurs and just gives a generic failure to connect when it is actually connecting just fine and having a problem storing the record. Matt (aka SirGeek) |
From: Lee G. <LGo...@UK...> - 2007-07-31 09:27:01
|
http://log4perl.sourceforge.net/releases/Log-Log4perl/docs/html/Log/Log4 perl/FAQ.html#e8a46 =20 The above entry in the FAQ, "How can I write my own appender," explains how to use Class::Prototyped to create a custom appender. =20 Is there any way of getting this into a Log4perl configuration file? =20 Lee Goddard Senior Software Developer Advertising.com, London =20 P Think of the environment before you print this email =20 |
From: Mesdaq, A. <am...@we...> - 2007-07-19 17:46:05
|
Ok so if I understand correctly some best practices in my case are - Modules do not call init. Ever! - :easy mode really means :lazy mode thus you SHOULD use it - Script that calls any module that uses log4perl or calls a module that calls another module that uses log4perl should do the init call - Use one configuration file for all modules using log4perl and split them via categories Curious why is log4perl constrained like that? Is it something to do with constants? Was there a technical trade off? Thanks, ------------------------------------------ Ali Mesdaq Security Researcher II Websense Security Labs http://www.WebsenseSecurityLabs.com ------------------------------------------ -----Original Message----- From: Mike Schilli [mailto:m...@pe...]=20 Sent: Wednesday, July 18, 2007 9:37 PM To: Mesdaq, Ali Cc: log...@li... Subject: Re: [log4perl-devel] Initializing Question On Wed, 18 Jul 2007, Mesdaq, Ali wrote: > But something I am still confused about is the initialize once and=20 > only once that is discussed in the docs. If I have several modules=20 > that use each other and they all use log4perl how does that impact me? > Is the initialize once and only once referring to per module or object > or per process or per system? If its any of the latter two then=20 > wouldn't you always want to use init_once? Only the main program should call init(). Modules should not use init(). init_once() is useful only in scenarios where your code runs by the same init() call more than once and you want to run init() only the first time (e.g. with CGI scripts running under Apache::Registry). -- Mike Mike Schilli m...@pe... |
From: Mike S. <m...@pe...> - 2007-07-19 04:37:36
|
On Wed, 18 Jul 2007, Mesdaq, Ali wrote: > But something I am still confused about is the initialize once and > only once that is discussed in the docs. If I have several modules > that use each other and they all use log4perl how does that impact me? > Is the initialize once and only once referring to per module or object > or per process or per system? If its any of the latter two then > wouldn't you always want to use init_once? Only the main program should call init(). Modules should not use init(). init_once() is useful only in scenarios where your code runs by the same init() call more than once and you want to run init() only the first time (e.g. with CGI scripts running under Apache::Registry). -- Mike Mike Schilli m...@pe... |
From: Mesdaq, A. <am...@we...> - 2007-07-18 17:03:44
|
I would use Log::Log4perl qw(:lazy) proudly! :-) Using init is perfect. I suspected that other init methods worked with easy/lazy mode but I didn't see a example in the docs and didn't have time to test it out. But something I am still confused about is the initialize once and only once that is discussed in the docs. If I have several modules that use each other and they all use log4perl how does that impact me? Is the initialize once and only once referring to per module or object or per process or per system? If its any of the latter two then wouldn't you always want to use init_once? Thanks, ------------------------------------------ Ali Mesdaq Security Researcher II Websense Security Labs http://www.WebsenseSecurityLabs.com ------------------------------------------ -----Original Message----- From: Mike Schilli [mailto:m...@pe...]=20 Sent: Tuesday, July 17, 2007 8:46 PM To: Mesdaq, Ali Cc: Mike Schilli; log...@li... Subject: RE: [log4perl-devel] Initializing Question On Tue, 17 Jul 2007, Mesdaq, Ali wrote: > Great I am going to read the documentation on that now. Maybe you=20 > should rename easy mode to something more inviting for us geeks :-) we > all like to think of ourselves as power users. Maybe this :) ? use Log::Log4perl qw(:lazy); > Anyways after looking at the docs some more I didn't see a way I could > setup email dispatcher's for certain log level's or categories. At=20 > first I was assuming I could pass any hashref to easy_init and it=20 > would initialize based on that. easy_init() is for simple screen/file appenders only. But you can certainly combine :easy mode (giving you DEBUG/INFO/... macros and the stealth loggers) with init() and a regular configuration file. Gives you the best of both worlds. If you don't want a config file, you can use init() with a string or a hashref as outlined in the docs. -- Mike Mike Schilli m...@pe... > But I looked at the code for easy_init and it looks like the only=20 >options available are level, file, category, and layout. I think it=20 >would be really flexible if the options to pass in are mapped closely=20 >to conf file settings or just take all settings as if they were lines=20 >of a config file. > > Maybe its possible via some other method but the easy_init looks like=20 > its not doing that now and based on the docs I was reading it seems=20 > the only way to initialize in easy mode is via easy_init. > > Thanks, > ------------------------------------------ > Ali Mesdaq > Security Researcher II > Websense Security Labs > http://www.WebsenseSecurityLabs.com > ------------------------------------------ > > -----Original Message----- > From: Mike Schilli [mailto:m...@pe...] > Sent: Sunday, July 15, 2007 10:02 AM > To: Mesdaq, Ali > Cc: log...@li... > Subject: Re: [log4perl-devel] Initializing Question > > On Fri, 13 Jul 2007, Mesdaq, Ali wrote: > > > The usual order that things are used in my case I write some=20 > > functionality in a module and I might call another module which=20 > > calls another and I will write a script that interfaces with the=20 > > first module. Ideally I wish I could have shortcut calls like in the > > easy mode to save the extra typing of $this->{logger}->. Shortcuts=20 > > in typing make log::trace appealing but it can't compare in=20 > > functionality. > > I think what you need is already there: Just use :easy mode. > > In a package, if you write > > package Foo; > use Log::Log4perl qw(:easy); > > then Log4perl will do two things when the module gets loaded: > > 1) Create a 'stealth logger' for the package > 2) Introduce TRACE/DEBUG/INFO/WARN ... macros so that you don't > have to run get_logger() to log something. > > The macros will use the 'stealth logger', so they don't have to call > get_logger() internally (explained in the main Log::Log4perl manpage). > > Easy mode is not only for simple scripts. It usually runs even faster=20 > than regular mode. I'm using it almost exclusively in everything I=20 > write, easy or complex. > > > I have to say log4perl is a nice piece of work. You can appreciate=20 > > it so much more after you spend some time writing your own logging=20 > > module > > > and resolving annoying issues then you see a super logging module=20 > > like > > > this. > > Thanks for the note, I appreciate it! > > -- Mike > > Mike Schilli > m...@pe... > > > > > Thanks, > > ------------------------------------------ > > Ali Mesdaq > > Security Researcher II > > Websense Security Labs > > http://www.WebsenseSecurityLabs.com > > ------------------------------------------ > > > > -------------------------------------------------------------------- > > -- > > --- This SF.net email is sponsored by DB2 Express Download DB2=20 > > Express > > > C - the FREE version of DB2 express and take control of your XML. No > > limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > log4perl-devel mailing list > > log...@li... > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > > |
From: Mike S. <m...@pe...> - 2007-07-18 04:03:59
|
On Tue, 17 Jul 2007, Michael Schmitz wrote: > Mike> This is what most users want. However, thinking about it, we > Mike> could add a "create_at_logtime" option to the file Mike> > appender. Would that help? > > Yes, this would be GREAT! You got it, it's checked into CVS for Log::Log4perl 1.13. -- Mike Mike Schilli m...@pe... |
From: Mike S. <m...@pe...> - 2007-07-18 03:45:50
|
On Tue, 17 Jul 2007, Mesdaq, Ali wrote: > Great I am going to read the documentation on that now. Maybe you should > rename easy mode to something more inviting for us geeks :-) we all like > to think of ourselves as power users. Maybe this :) ? use Log::Log4perl qw(:lazy); > Anyways after looking at the docs some more I didn't see a way I could > setup email dispatcher's for certain log level's or categories. At > first I was assuming I could pass any hashref to easy_init and it > would initialize based on that. easy_init() is for simple screen/file appenders only. But you can certainly combine :easy mode (giving you DEBUG/INFO/... macros and the stealth loggers) with init() and a regular configuration file. Gives you the best of both worlds. If you don't want a config file, you can use init() with a string or a hashref as outlined in the docs. -- Mike Mike Schilli m...@pe... > But I looked at the code for easy_init and it looks like the only >options available are level, file, category, and layout. I think it >would be really flexible if the options to pass in are mapped closely >to conf file settings or just take all settings as if they were lines >of a config file. > > Maybe its possible via some other method but the easy_init looks like > its not doing that now and based on the docs I was reading it seems the > only way to initialize in easy mode is via easy_init. > > Thanks, > ------------------------------------------ > Ali Mesdaq > Security Researcher II > Websense Security Labs > http://www.WebsenseSecurityLabs.com > ------------------------------------------ > > -----Original Message----- > From: Mike Schilli [mailto:m...@pe...] > Sent: Sunday, July 15, 2007 10:02 AM > To: Mesdaq, Ali > Cc: log...@li... > Subject: Re: [log4perl-devel] Initializing Question > > On Fri, 13 Jul 2007, Mesdaq, Ali wrote: > > > The usual order that things are used in my case I write some > > functionality in a module and I might call another module which calls > > another and I will write a script that interfaces with the first > > module. Ideally I wish I could have shortcut calls like in the easy > > mode to save the extra typing of $this->{logger}->. Shortcuts in > > typing make log::trace appealing but it can't compare in > > functionality. > > I think what you need is already there: Just use :easy mode. > > In a package, if you write > > package Foo; > use Log::Log4perl qw(:easy); > > then Log4perl will do two things when the module gets loaded: > > 1) Create a 'stealth logger' for the package > 2) Introduce TRACE/DEBUG/INFO/WARN ... macros so that you don't > have to run get_logger() to log something. > > The macros will use the 'stealth logger', so they don't have to call > get_logger() internally (explained in the main Log::Log4perl manpage). > > Easy mode is not only for simple scripts. It usually runs even faster > than regular mode. I'm using it almost exclusively in everything I > write, easy or complex. > > > I have to say log4perl is a nice piece of work. You can appreciate it > > so much more after you spend some time writing your own logging module > > > and resolving annoying issues then you see a super logging module like > > > this. > > Thanks for the note, I appreciate it! > > -- Mike > > Mike Schilli > m...@pe... > > > > > Thanks, > > ------------------------------------------ > > Ali Mesdaq > > Security Researcher II > > Websense Security Labs > > http://www.WebsenseSecurityLabs.com > > ------------------------------------------ > > > > ---------------------------------------------------------------------- > > --- This SF.net email is sponsored by DB2 Express Download DB2 Express > > > C - the FREE version of DB2 express and take control of your XML. No > > limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > log4perl-devel mailing list > > log...@li... > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > > |
From: Mesdaq, A. <am...@we...> - 2007-07-17 19:47:20
|
Great I am going to read the documentation on that now. Maybe you should rename easy mode to something more inviting for us geeks :-) we all like to think of ourselves as power users. Anyways after looking at the docs some more I didn't see a way I could setup email dispatcher's for certain log level's or categories. At first I was assuming I could pass any hashref to easy_init and it would initialize based on that. But I looked at the code for easy_init and it looks like the only options available are level, file, category, and layout. I think it would be really flexible if the options to pass in are mapped closely to conf file settings or just take all settings as if they were lines of a config file.=20 Maybe its possible via some other method but the easy_init looks like its not doing that now and based on the docs I was reading it seems the only way to initialize in easy mode is via easy_init. Thanks, ------------------------------------------ Ali Mesdaq Security Researcher II Websense Security Labs http://www.WebsenseSecurityLabs.com ------------------------------------------ -----Original Message----- From: Mike Schilli [mailto:m...@pe...]=20 Sent: Sunday, July 15, 2007 10:02 AM To: Mesdaq, Ali Cc: log...@li... Subject: Re: [log4perl-devel] Initializing Question On Fri, 13 Jul 2007, Mesdaq, Ali wrote: > The usual order that things are used in my case I write some=20 > functionality in a module and I might call another module which calls=20 > another and I will write a script that interfaces with the first=20 > module. Ideally I wish I could have shortcut calls like in the easy=20 > mode to save the extra typing of $this->{logger}->. Shortcuts in=20 > typing make log::trace appealing but it can't compare in=20 > functionality. I think what you need is already there: Just use :easy mode. In a package, if you write package Foo; use Log::Log4perl qw(:easy); then Log4perl will do two things when the module gets loaded: 1) Create a 'stealth logger' for the package 2) Introduce TRACE/DEBUG/INFO/WARN ... macros so that you don't have to run get_logger() to log something. The macros will use the 'stealth logger', so they don't have to call get_logger() internally (explained in the main Log::Log4perl manpage). Easy mode is not only for simple scripts. It usually runs even faster than regular mode. I'm using it almost exclusively in everything I write, easy or complex. > I have to say log4perl is a nice piece of work. You can appreciate it=20 > so much more after you spend some time writing your own logging module > and resolving annoying issues then you see a super logging module like > this. Thanks for the note, I appreciate it! -- Mike Mike Schilli m...@pe... > > Thanks, > ------------------------------------------ > Ali Mesdaq > Security Researcher II > Websense Security Labs > http://www.WebsenseSecurityLabs.com > ------------------------------------------ > > ---------------------------------------------------------------------- > --- This SF.net email is sponsored by DB2 Express Download DB2 Express > C - the FREE version of DB2 express and take control of your XML. No=20 > limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |
From: Michael S. <Mic...@ti...> - 2007-07-17 12:30:02
|
>>>>> "Mike" == Mike Schilli <m...@pe...> writes: Mike> On Fri, 13 Jul 2007, Michael Schmitz wrote: >> This is in fact a drastic approach. As regards problems that >> prevent proper logging, I agree with you, but this is not the >> case for me. >> >> Different application running with different privileges share a >> common configuration file. It would be a problem if an >> unprivileged application uses a logger that logs to a file the >> user cannot write to, but this is not the case. As long as the >> application attempts to use the correct logger (which is the >> case), ie. the one it is meant to use, and this logger is >> associated with a file the unprivileged user can write to, it >> is fine from my point of view. Mike> The problem is that there are no "unused" appenders at Mike> init() time. An application acquires loggers at runtime, so Mike> it could potentially use any of the appenders defined in the Mike> configuration file. >> If log4perl would check for the appropriate permission when an >> application creates the logger, it could (and it should) let >> the user know. Checking in the initialization phase anticipates >> problems that may not even occur. Mike> Log4perl creates file appender files at init() time to make Mike> sure that there's no rude awakening after days/weeks/months Mike> of operation when some part of the application suddenly Mike> wants to write to an appender and it can't because of Mike> permission problems known at init() time. Mike> This is what most users want. However, thinking about it, we Mike> could add a "create_at_logtime" option to the file Mike> appender. Would that help? Yes, this would be GREAT! Michael. |
From: Mike S. <m...@pe...> - 2007-07-15 17:01:39
|
On Fri, 13 Jul 2007, Mesdaq, Ali wrote: > The usual order that things are used in my case I write some > functionality in a module and I might call another module which calls > another and I will write a script that interfaces with the first > module. Ideally I wish I could have shortcut calls like in the easy > mode to save the extra typing of $this->{logger}->. Shortcuts in > typing make log::trace appealing but it can't compare in > functionality. I think what you need is already there: Just use :easy mode. In a package, if you write package Foo; use Log::Log4perl qw(:easy); then Log4perl will do two things when the module gets loaded: 1) Create a 'stealth logger' for the package 2) Introduce TRACE/DEBUG/INFO/WARN ... macros so that you don't have to run get_logger() to log something. The macros will use the 'stealth logger', so they don't have to call get_logger() internally (explained in the main Log::Log4perl manpage). Easy mode is not only for simple scripts. It usually runs even faster than regular mode. I'm using it almost exclusively in everything I write, easy or complex. > I have to say log4perl is a nice piece of work. You can appreciate it > so much more after you spend some time writing your own logging module > and resolving annoying issues then you see a super logging module like > this. Thanks for the note, I appreciate it! -- Mike Mike Schilli m...@pe... > > Thanks, > ------------------------------------------ > Ali Mesdaq > Security Researcher II > Websense Security Labs > http://www.WebsenseSecurityLabs.com > ------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |
From: Mesdaq, A. <am...@we...> - 2007-07-13 19:05:59
|
Hello Everyone, I had a question about initialization. Now this may be discussed in the documents but I did not see it covered in depth and I had a long week so I may also just be brain dead. My question is how can I initialize the log4perl object so that its part of my object so I don't have to make a bunch of get logger calls in every sub routine. Usually what I do is in my initialization of my object I have a init routine that I use to add certain objects to my object like $this->{dbh} =3D DBI->connect blah... But I did not see this covered in the documentation and log4perl is more tricky than some other modules so I want to run that by you guys. The way I want to use log4perl is to make it standard part of all my modules but all my modules and objects use each other in certain cases to perform actions and I think I remember reading something about that possibly causing problems. The usual order that things are used in my case I write some functionality in a module and I might call another module which calls another and I will write a script that interfaces with the first module. Ideally I wish I could have shortcut calls like in the easy mode to save the extra typing of $this->{logger}->. Shortcuts in typing make log::trace appealing but it can't compare in functionality. I have to say log4perl is a nice piece of work. You can appreciate it so much more after you spend some time writing your own logging module and resolving annoying issues then you see a super logging module like this. Thanks, ------------------------------------------ Ali Mesdaq Security Researcher II Websense Security Labs http://www.WebsenseSecurityLabs.com ------------------------------------------ |
From: Mike S. <m...@pe...> - 2007-07-13 16:48:48
|
On Fri, 13 Jul 2007, Michael Schmitz wrote: > This is in fact a drastic approach. As regards problems that prevent > proper logging, I agree with you, but this is not the case for me. > > Different application running with different privileges share a common > configuration file. It would be a problem if an unprivileged > application uses a logger that logs to a file the user cannot write > to, but this is not the case. As long as the application attempts to > use the correct logger (which is the case), ie. the one it is meant to > use, and this logger is associated with a file the unprivileged user > can write to, it is fine from my point of view. The problem is that there are no "unused" appenders at init() time. An application acquires loggers at runtime, so it could potentially use any of the appenders defined in the configuration file. > If log4perl would check for the appropriate permission when an > application creates the logger, it could (and it should) let the user > know. Checking in the initialization phase anticipates problems that > may not even occur. Log4perl creates file appender files at init() time to make sure that there's no rude awakening after days/weeks/months of operation when some part of the application suddenly wants to write to an appender and it can't because of permission problems known at init() time. This is what most users want. However, thinking about it, we could add a "create_at_logtime" option to the file appender. Would that help? -- Mike Mike Schilli m...@pe... |
From: Michael S. <Mic...@ti...> - 2007-07-13 07:11:36
|
>>>>> "Mike" == Mike Schilli <m...@pe...> writes: Mike> On Thu, 12 Jul 2007, Michael Schmitz wrote: >> I have a configuration file that defines a number of >> loggers. All of them use a file-appender. As the configuration >> file is used by different applications running under different >> accounts (root and unprivileged accounts), not all files are >> writable by for all applications. >> >> When an unprivileged user starts an application, >> Log::Log4perl->init() fails, because the user does not have >> write permission on at least one of the log files: >> >> Can't open /home/mls/tmp/test/root-lf.log (Permission denied) >> at /usr/lib/perl5/site_perl/5.8.8/Log/Log4perl/Appender/File.pm >> line 97. >> >> As this happens in initialization, the application doesn't even >> come to the point where it obtains its own logger. >> >> Is this behaviour intentional in log4perl v1.12 or is it a bug? Mike> That's intentional. If Log4perl can't open a file associated Mike> with a file appender, it dies. This might seem drastic, but Mike> if a logging system can't log its errors, it's the safest Mike> thing do abort and let the user know. This is in fact a drastic approach. As regards problems that prevent proper logging, I agree with you, but this is not the case for me. Different application running with different privileges share a common configuration file. It would be a problem if an unprivileged application uses a logger that logs to a file the user cannot write to, but this is not the case. As long as the application attempts to use the correct logger (which is the case), ie. the one it is meant to use, and this logger is associated with a file the unprivileged user can write to, it is fine from my point of view. If log4perl would check for the appropriate permission when an application creates the logger, it could (and it should) let the user know. Checking in the initialization phase anticipates problems that may not even occur. Mike> If you don't like it, you can catch the error via eval {} Mike> around init, but I wouldn't recommend doing that. Yes I will have to do this, but this is only part of the truth, as I will have to check for write permission when obtaining the logger. Michael. |
From: Berg, E. <eri...@le...> - 2007-07-12 17:26:36
|
Can anybody shine any light on how I could use l4p with TT? Thanks. -Eric. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - = - - - - - - - This message is intended only for the personal and confidential use of the = designated recipient(s) named above. If you are not the intended = recipient of this message you are hereby notified that any review, = dissemination, distribution or copying of this message is strictly = prohibited. This communication is for information purposes only and = should not be regarded as an offer to sell or as a solicitation of an = offer to buy any financial product, an official confirmation of any = transaction, or as an official statement of Lehman Brothers. Email = transmission cannot be guaranteed to be secure or error-free. Therefore, = we do not represent that this information is complete or accurate and it = should not be relied upon as such. All information is subject to change = without notice. -------- IRS Circular 230 Disclosure: Please be advised that any discussion of U.S. tax matters contained within = this communication (including any attachments) is not intended or written = to be used and cannot be used for the purpose of (i) avoiding U.S. tax = related penalties or (ii) promoting, marketing or recommending to another = party any transaction or matter addressed herein. |
From: Mike S. <m...@pe...> - 2007-07-12 17:24:48
|
On Thu, 12 Jul 2007, Michael Schmitz wrote: > I have a configuration file that defines a number of loggers. All of > them use a file-appender. As the configuration file is used by > different applications running under different accounts (root and > unprivileged accounts), not all files are writable by for all > applications. > > When an unprivileged user starts an application, Log::Log4perl->init() > fails, because the user does not have write permission on at least one > of the log files: > > Can't open /home/mls/tmp/test/root-lf.log (Permission denied) at /usr/lib/perl5/site_perl/5.8.8/Log/Log4perl/Appender/File.pm line 97. > > As this happens in initialization, the application doesn't even come to > the point where it obtains its own logger. > > Is this behaviour intentional in log4perl v1.12 or is it a bug? That's intentional. If Log4perl can't open a file associated with a file appender, it dies. This might seem drastic, but if a logging system can't log its errors, it's the safest thing do abort and let the user know. If you don't like it, you can catch the error via eval {} around init, but I wouldn't recommend doing that. You can resolve the problem by making sure permissions are ok. This can be done by using different logfiles for different users, setting group permissions (umask parameter in the file appender) or switching to a syslog appender. -- Mike Mike Schilli m...@pe... |
From: Michael S. <Mic...@ti...> - 2007-07-12 11:42:09
|
Hello all, I have a configuration file that defines a number of loggers. All of them use a file-appender. As the configuration file is used by different applications running under different accounts (root and unprivileged accounts), not all files are writable by for all applications. When an unprivileged user starts an application, Log::Log4perl->init() fails, because the user does not have write permission on at least one of the log files: Can't open /home/mls/tmp/test/root-lf.log (Permission denied) at /usr/lib/perl5/site_perl/5.8.8/Log/Log4perl/Appender/File.pm line 97. As this happens in initialization, the application doesn't even come to the point where it obtains its own logger. Is this behaviour intentional in log4perl v1.12 or is it a bug? Michael. |
From: Quinn W. <qu...@fa...> - 2007-07-04 16:57:25
|
On Tue, Jul 03, 2007 at 10:43:30PM -0700, Mike Schilli wrote: > The warp_message option is only for appenders which can handle an array > ref instead of a message string. The DBI appender is the only example in > the L4p distribution. Or, you can write your own appender (if you look > at the screen appender or the FAQ, you'll see that this is trivial). Thanks. I may decide to go this route. > This raises the question: What are you trying to do? Why do you need > warp_message? I don't see how you could use it in a meaningful way with > the default screen appender. I am trying to graft several fancy features onto log4perl. Notes: I think I could do 1 using warp_message. I suspect I _couldn't_ do 2 and 3, because the stack trace (%T) is not part of the @_ passed to the warp_message sub... but I hadn't gotten that far when I realized that Log::Log4perl::Appender::Screen doesn't support warp_message. Features: 1) Automagically use Data::Dumper on any references passed. E.g. if I do debug( 'The hash was ', \%hash, ' and the array was ', $array_ref ); I want log4perl to dump those refs for me. Laziness. :) 2) Limit stack traces by number of stack frames, not by number of characters. Actually, I think this would be a nice feature to add to log4perl sometime. What do you think? I see l4p uses Carp::longmess; if it used Devel::StackTrace, this would be easier. For now, I was just trying to kludge it in by doing a regex substitution on the whole longmess. 3) Filter out Catalyst internals from stack traces. This would also be easier with Devel::StackTrace, because it provides an ignore_package option (see http://search.cpan.org/~drolsky/Devel-StackTrace-1.15/lib/Devel/StackTrace.pm ). For now, I was planning to, again, regex-massage the stack trace. But, again, I'm not sure I even get access to the stack trace in the warp_message sub. Anyway... since warp_message doesn't seem to DWIM, I will probably implement these features by hacking or subclassing Catalyst::Log::Log4perl. It defines versions of debug, info, et cetera that enqueue your messages; then later its _flush method gets called and sends them on to log4perl. So I can hack the enqueueing methods to "warp" my message as I desire. I hope this message was interesting to someone. :) -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ 510-520-5217 |
From: Mike S. <m...@pe...> - 2007-07-04 05:43:41
|
On Tue, 3 Jul 2007, Quinn Weaver wrote: > So, the POD for Log::Log4perl::Appender describes the warp_message property, > and gives some examples. It seems I should be able to return an array, which > should be join'ed and used as the basis for my message. > > But it doesn't work; I get ARRAY(0xa19c948) and the like in my messages. > > I suspect the reason is that my particular appender type doesn't support > warp_message. The POD mentions that Log::Dispatch-based appenders don't work. > But Log::Log4perl::Appender::Screen doesn't work either. The warp_message option is only for appenders which can handle an array ref instead of a message string. The DBI appender is the only example in the L4p distribution. Or, you can write your own appender (if you look at the screen appender or the FAQ, you'll see that this is trivial). This raises the question: What are you trying to do? Why do you need warp_message? I don't see how you could use it in a meaningful way with the default screen appender. -- Mike Mike Schilli m...@pe... > > So... which appenders support it, and which don't? The POD should be > more specific, methinks. Thanks for any elucidation you can lend. > > # from my log4perl.conf: > log4perl.appender.screenAppender = Log::Log4perl::Appender::Screen > log4perl.appender.screenAppender.layout = Log::Log4perl::Layout::PatternLayout > log4perl.appender.screenAppender.layout.ConversionPattern \ > = %d{MMM dd HH:mm:ss} %H: process %8P: client %X{ip}: %X{uri}: %5p: %m%n > log4perl.appender.screenAppender.warp_message = sub { return @_ } > > Thanks, > > -- > Quinn Weaver, independent contractor | President, San Francisco Perl Mongers > http://fairpath.com/quinn/resume/ | http://sf.pm.org/ > 510-520-5217 > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |
From: Quinn W. <qu...@fa...> - 2007-07-03 23:28:20
|
So, the POD for Log::Log4perl::Appender describes the warp_message property, and gives some examples. It seems I should be able to return an array, which should be join'ed and used as the basis for my message. But it doesn't work; I get ARRAY(0xa19c948) and the like in my messages. I suspect the reason is that my particular appender type doesn't support warp_message. The POD mentions that Log::Dispatch-based appenders don't work. But Log::Log4perl::Appender::Screen doesn't work either. So... which appenders support it, and which don't? The POD should be more specific, methinks. Thanks for any elucidation you can lend. # from my log4perl.conf: log4perl.appender.screenAppender = Log::Log4perl::Appender::Screen log4perl.appender.screenAppender.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.screenAppender.layout.ConversionPattern \ = %d{MMM dd HH:mm:ss} %H: process %8P: client %X{ip}: %X{uri}: %5p: %m%n log4perl.appender.screenAppender.warp_message = sub { return @_ } Thanks, -- Quinn Weaver, independent contractor | President, San Francisco Perl Mongers http://fairpath.com/quinn/resume/ | http://sf.pm.org/ 510-520-5217 |
From: Berg, E. <eri...@le...> - 2007-07-01 13:59:49
|
=20 -----Original Message----- From: Mike Schilli =5Bmailto:m=40perlmeister.com=5D=20 Sent: Thursday, June 28, 2007 8:45 PM To: Berg, Eric Cc: Mike Schilli; log4perl-devel=40lists.sourceforge.net Subject: RE: =5Blog4perl-devel=5D When a missing config file >> Another solution would be wildcard/regex categories. Can we do that? > > What's the problem you're trying to solve there? I like this one quite a bit, actually. I've got a number of classes that have methods called =22run=22, and I'd like to be able to change the log level for just the run() methods all at once. log4perl.logger.Class.Path1.run DEBUG, DebugLog log4perl.logger.Class.Path2.run DEBUG, DebugLog log4perl.logger.Class.Path3.run DEBUG, DebugLog Could nicely be written as: log4perl.logger.Class=5C.Path.*=5C.run DEBUG, DebugLog Or a little finer grained: log4perl.logger.Class.Path=5B13=5D.run DEBUG, DebugLog -Eric. > > Thanks=21 > > -Eric. > > -----Original Message----- > From: Mike Schilli =5Bmailto:m=40perlmeister.com=5D > Sent: Thursday, June 28, 2007 7:54 PM > To: Berg, Eric > Cc: log4perl-devel=40lists.sourceforge.net > Subject: Re: =5Blog4perl-devel=5D When a missing config file > > On Thu, 28 Jun 2007, Berg, Eric wrote: > > > I've been looking for a way to get l4p to tell me where the config=20 > > under which it's running comes from. Essentially, I'd like to have=20 > > a method that would return the full path to the config file that=20 > > it's currently using. > > > > Obviously, there are complications, such as those relating to=20 > > programatic configuration subsequent to loading configs from a file, > > in-line, and config (ini) files, but I could find nowhere that the=20 > > file name passed in to init() is retrievable. > > The name of the file isn't stored usually, since you can not only use=20 > a file but a string, a hashref, an URL, etc. to initialize L4p. > > Since you're calling init() in the first place, wouldn't it be easier=20 > to store the filename in your application instead? > > -- Mike > > Mike Schilli > m=40perlmeister.com > > > > > -Eric. > > > > -----Original Message----- > > From: log4perl-devel-bounces=40lists.sourceforge.net > > =5Bmailto:log4perl-devel-bounces=40lists.sourceforge.net=5D On Behalf = Of=20 > > John ORourke > > Sent: Thursday, June 28, 2007 6:42 AM > > To: Lee Goddard > > Cc: log4perl-devel=40lists.sourceforge.net > > Subject: Re: =5Blog4perl-devel=5D When a missing config file > > > > Try putting: > > > > use Error; > > > > in one of your modules/scripts - it will override the warn/die=20 > > handlers globally, so unless Log4perl overrides them again it will=20 > > give you a stack trace. > > > > cheers > > John > > > > Lee Goddard wrote: > > > > > > Please could Log/Log4perl/Config.pm line 619 offer a stack=20 > > > backtrace > > > > as well as barfing? > > > > > > My current project has four config files, several potential=20 > > > initialisers (bad idea, I know) and reports only via e-mail, since > > > it is part of a MTA process. > > > > > > Thanks in anticipation > > > > > > Lee > > > > > > > > > > > > > > > > > > =23 The Postfix program > > > > > > =23 > > > > > > =23 <tqm=40uk-sandbox.corp.advertising.com>: Command died with status 2: > > > =22perl > > > > > > =23 -I/home/lgoddard/trafficjam/trunk/lib > > > -MTrafficJam::Controller::Root -e > > > > > > =23 'warn TrafficJam::Controller::Root->mail_in'=22. Command output: > > > Cannot open > > > > > > =23 config file '/home/lgoddard/trafficjam/trunk/config/mail.l4p' > at > > > > > > =23 /usr/local/share/perl/5.8.4/Log/Log4perl/Config.pm line 619, > > > <STDIN> line > > > > > > =23 26. > > > > > > =23 > > > > > > > > > > > > Lee Goddard > > > > > > Senior Software Developer > > > > > > Advertising.com, London > > > > > > > > > > > > P Think of the environment before you print this email > > > > > > > > > > > > ------------------------------------------------------------------ > > > -- > > > -- > > > -- > > > > > > ------------------------------------------------------------------ > > > -- > > > -- > > > --- This SF.net email is sponsored by DB2 Express Download DB2=20 > > > Express > > > > > C - the FREE version of DB2 express and take control of your XML.=20 > > > No > > > > limits. Just data. Click to get it now. > > > http://sourceforge.net/powerbar/db2/ > > > ------------------------------------------------------------------ > > > -- > > > -- > > > -- > > > > > > _______________________________________________ > > > log4perl-devel mailing list > > > log4perl-devel=40lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > > > > > > > > -------------------------------------------------------------------- > > -- > > -- > > - > > This SF.net email is sponsored by DB2 Express Download DB2 Express C > > - > > > the FREE version of DB2 express and take control of your XML. No > limits. > > Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > log4perl-devel mailing list > > log4perl-devel=40lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -=20 > > - > > - - - - - - - - - > > > > This message is intended only for the personal and confidential use=20 > > of > the designated recipient(s) named above. If you are not the intended=20 > recipient of this message you are hereby notified that any review,=20 > dissemination, distribution or copying of this message is strictly=20 > prohibited. This communication is for information purposes only and=20 > should not be regarded as an offer to sell or as a solicitation of an=20 > offer to buy any financial product, an official confirmation of any=20 > transaction, or as an official statement of Lehman Brothers. Email=20 > transmission cannot be guaranteed to be secure or error-free. > Therefore, we do not represent that this information is complete or=20 > accurate and it should not be relied upon as such. All information is > subject to change without notice. > > > > -------- > > IRS Circular 230 Disclosure: > > Please be advised that any discussion of U.S. tax matters contained > within this communication (including any attachments) is not intended=20 > or written to be used and cannot be used for the purpose of (i)=20 > avoiding U.S. tax related penalties or (ii) promoting, marketing or=20 > recommending to another party any transaction or matter addressed herein. > > > > > > > > -------------------------------------------------------------------- > > -- > > --- This SF.net email is sponsored by DB2 Express Download DB2=20 > > Express > > > C - the FREE version of DB2 express and take control of your XML. No > > limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > log4perl-devel mailing list > > log4perl-devel=40lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -=20 > - - - - - - - - - > > This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. > > -------- > IRS Circular 230 Disclosure: > Please be advised that any discussion of U.S. tax matters contained within this communication (including any attachments) is not intended or written to be used and cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein. > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - = - - - - - - - This message is intended only for the personal and confidential use of the = designated recipient(s) named above. If you are not the intended = recipient of this message you are hereby notified that any review, = dissemination, distribution or copying of this message is strictly = prohibited. This communication is for information purposes only and = should not be regarded as an offer to sell or as a solicitation of an = offer to buy any financial product, an official confirmation of any = transaction, or as an official statement of Lehman Brothers. Email = transmission cannot be guaranteed to be secure or error-free. Therefore, = we do not represent that this information is complete or accurate and it = should not be relied upon as such. All information is subject to change = without notice. -------- IRS Circular 230 Disclosure: Please be advised that any discussion of U.S. tax matters contained within = this communication (including any attachments) is not intended or written = to be used and cannot be used for the purpose of (i) avoiding U.S. tax = related penalties or (ii) promoting, marketing or recommending to another = party any transaction or matter addressed herein. |
From: Berg, E. <eri...@le...> - 2007-06-29 13:45:24
|
Thanks, Mike. Extremely helpful. I've never used caller for anything but endeavors of curiosity. I've read that document before, but... Here's what I quickly came up with: sub get_logger =7B =2E.. =23 get the caller that we want. =40caller =3D caller(1); =24package =3D =24caller=5B0=5D; =40log_focus =3D split( '::', =24package ); =23 If there's a category submitted to this sub, append it to =40log_focus if (=24category) =7B push( =40log_focus, =24category ) =7D =24log_focus =3D join( '.', =40log_focus ); =24logger =3D Log::Log4perl::get_logger(=24log_focus); return =24logger; =7D Obviously, this is a much better way to do this. I guess a short recursive subroutine which uses caller could tell you in which package a function is defined. And that's how carp works, huh? Pretty cool. Thank you very much. -Eric -----Original Message----- From: Mike Schilli =5Bmailto:m=40perlmeister.com=5D=20 Sent: Thursday, June 28, 2007 8:45 PM To: Berg, Eric Cc: Mike Schilli; log4perl-devel=40lists.sourceforge.net Subject: RE: =5Blog4perl-devel=5D When a missing config file On Thu, 28 Jun 2007, Berg, Eric wrote: > Are there any best practices, examples, etc. for the best way to=20 > provide a wrapper to log? Here's a couple of hints: http://log4perl.sourceforge.net/d/Log/Log4perl.html=236acb7 > I'm using some of the sample code that provides a _get_logger()=20 > function that derives the category based on the package from which=20 > it's called Isn't that already provided by __PACKAGE__? > , but I've created a problem for myself when it's in an inherited=20 > class in a subclass called in a subclass -- my wrapper is set up to=20 > provide _get_logger() as an inherited method -- because if I define a=20 > method in a superclass, and it's called in a subclass, then I can't=20 > just enable logging for the method in the superclass, because it's the > package name of the subclass from which the category is derived. Hmm, any reason why you aren't simply using Log4perl's get_logger()? > So, to reiterate, I have a class hierarchy, and the top-level class is > the one that does a > > use base qw(My::Logger); > > Then, when one of my subclasses calls _get_logger(), it creates a=20 > logger with the category of the subclass, whereas at least sometimes I > want to enable logging for that inherited method whenever it's called. Just to clarify: Is this your application or your logger class hierarchy? If the former, it shouldn't be a subclass of Logger. If the latter, you probably want to use L4p's get_logger() and pass it the category you want. > Another solution would be wildcard/regex categories. Can we do that? What's the problem you're trying to solve there? -- Mike Mike Schilli m=40perlmeister.com > > Thanks=21 > > -Eric. > > -----Original Message----- > From: Mike Schilli =5Bmailto:m=40perlmeister.com=5D > Sent: Thursday, June 28, 2007 7:54 PM > To: Berg, Eric > Cc: log4perl-devel=40lists.sourceforge.net > Subject: Re: =5Blog4perl-devel=5D When a missing config file > > On Thu, 28 Jun 2007, Berg, Eric wrote: > > > I've been looking for a way to get l4p to tell me where the config=20 > > under which it's running comes from. Essentially, I'd like to have=20 > > a method that would return the full path to the config file that=20 > > it's currently using. > > > > Obviously, there are complications, such as those relating to=20 > > programatic configuration subsequent to loading configs from a file, > > in-line, and config (ini) files, but I could find nowhere that the=20 > > file name passed in to init() is retrievable. > > The name of the file isn't stored usually, since you can not only use=20 > a file but a string, a hashref, an URL, etc. to initialize L4p. > > Since you're calling init() in the first place, wouldn't it be easier=20 > to store the filename in your application instead? > > -- Mike > > Mike Schilli > m=40perlmeister.com > > > > > -Eric. > > > > -----Original Message----- > > From: log4perl-devel-bounces=40lists.sourceforge.net > > =5Bmailto:log4perl-devel-bounces=40lists.sourceforge.net=5D On Behalf = Of=20 > > John ORourke > > Sent: Thursday, June 28, 2007 6:42 AM > > To: Lee Goddard > > Cc: log4perl-devel=40lists.sourceforge.net > > Subject: Re: =5Blog4perl-devel=5D When a missing config file > > > > Try putting: > > > > use Error; > > > > in one of your modules/scripts - it will override the warn/die=20 > > handlers globally, so unless Log4perl overrides them again it will=20 > > give you a stack trace. > > > > cheers > > John > > > > Lee Goddard wrote: > > > > > > Please could Log/Log4perl/Config.pm line 619 offer a stack=20 > > > backtrace > > > > as well as barfing? > > > > > > My current project has four config files, several potential=20 > > > initialisers (bad idea, I know) and reports only via e-mail, since > > > it is part of a MTA process. > > > > > > Thanks in anticipation > > > > > > Lee > > > > > > > > > > > > > > > > > > =23 The Postfix program > > > > > > =23 > > > > > > =23 <tqm=40uk-sandbox.corp.advertising.com>: Command died with status 2: > > > =22perl > > > > > > =23 -I/home/lgoddard/trafficjam/trunk/lib > > > -MTrafficJam::Controller::Root -e > > > > > > =23 'warn TrafficJam::Controller::Root->mail_in'=22. Command output: > > > Cannot open > > > > > > =23 config file '/home/lgoddard/trafficjam/trunk/config/mail.l4p' > at > > > > > > =23 /usr/local/share/perl/5.8.4/Log/Log4perl/Config.pm line 619, > > > <STDIN> line > > > > > > =23 26. > > > > > > =23 > > > > > > > > > > > > Lee Goddard > > > > > > Senior Software Developer > > > > > > Advertising.com, London > > > > > > > > > > > > P Think of the environment before you print this email > > > > > > > > > > > > ------------------------------------------------------------------ > > > -- > > > -- > > > -- > > > > > > ------------------------------------------------------------------ > > > -- > > > -- > > > --- This SF.net email is sponsored by DB2 Express Download DB2=20 > > > Express > > > > > C - the FREE version of DB2 express and take control of your XML.=20 > > > No > > > > limits. Just data. Click to get it now. > > > http://sourceforge.net/powerbar/db2/ > > > ------------------------------------------------------------------ > > > -- > > > -- > > > -- > > > > > > _______________________________________________ > > > log4perl-devel mailing list > > > log4perl-devel=40lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > > > > > > > > -------------------------------------------------------------------- > > -- > > -- > > - > > This SF.net email is sponsored by DB2 Express Download DB2 Express C > > - > > > the FREE version of DB2 express and take control of your XML. No > limits. > > Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > log4perl-devel mailing list > > log4perl-devel=40lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -=20 > > - > > - - - - - - - - - > > > > This message is intended only for the personal and confidential use=20 > > of > the designated recipient(s) named above. If you are not the intended=20 > recipient of this message you are hereby notified that any review,=20 > dissemination, distribution or copying of this message is strictly=20 > prohibited. This communication is for information purposes only and=20 > should not be regarded as an offer to sell or as a solicitation of an=20 > offer to buy any financial product, an official confirmation of any=20 > transaction, or as an official statement of Lehman Brothers. Email=20 > transmission cannot be guaranteed to be secure or error-free. > Therefore, we do not represent that this information is complete or=20 > accurate and it should not be relied upon as such. All information is > subject to change without notice. > > > > -------- > > IRS Circular 230 Disclosure: > > Please be advised that any discussion of U.S. tax matters contained > within this communication (including any attachments) is not intended=20 > or written to be used and cannot be used for the purpose of (i)=20 > avoiding U.S. tax related penalties or (ii) promoting, marketing or=20 > recommending to another party any transaction or matter addressed herein. > > > > > > > > -------------------------------------------------------------------- > > -- > > --- This SF.net email is sponsored by DB2 Express Download DB2=20 > > Express > > > C - the FREE version of DB2 express and take control of your XML. No > > limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > log4perl-devel mailing list > > log4perl-devel=40lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -=20 > - - - - - - - - - > > This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. > > -------- > IRS Circular 230 Disclosure: > Please be advised that any discussion of U.S. tax matters contained within this communication (including any attachments) is not intended or written to be used and cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein. > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - = - - - - - - - This message is intended only for the personal and confidential use of the = designated recipient(s) named above. If you are not the intended = recipient of this message you are hereby notified that any review, = dissemination, distribution or copying of this message is strictly = prohibited. This communication is for information purposes only and = should not be regarded as an offer to sell or as a solicitation of an = offer to buy any financial product, an official confirmation of any = transaction, or as an official statement of Lehman Brothers. Email = transmission cannot be guaranteed to be secure or error-free. Therefore, = we do not represent that this information is complete or accurate and it = should not be relied upon as such. All information is subject to change = without notice. -------- IRS Circular 230 Disclosure: Please be advised that any discussion of U.S. tax matters contained within = this communication (including any attachments) is not intended or written = to be used and cannot be used for the purpose of (i) avoiding U.S. tax = related penalties or (ii) promoting, marketing or recommending to another = party any transaction or matter addressed herein. |
From: Lee G. <LGo...@UK...> - 2007-06-29 09:58:59
|
Mike Schilli [mailto:m...@pe...] wrote: >=20 > On Thu, 28 Jun 2007, Lee Goddard wrote: >=20 > > Please could Log/Log4perl/Config.pm line 619 offer a stack backtrace as > > well as barfing? > > > > My current project has four config files, several potential initialisers > > (bad idea, I know) and reports only via e-mail, since it is part of a > > MTA process. >=20 > Dumping a stack trace by default might be confusing to the casual L4p > user, but you can certainly use the following: >=20 > use Log::Log4perl; > use Carp; >=20 > eval { > Log::Log4perl->init(...); > }; >=20 > if($@) { > confess($@); > } >=20 > Would this work for you? That's what I've ended up with, but I just thought it logical that an error generated by an operator error, such as wrong path to a config file, would Carp::croak, to let the user know from whence their error came.... Lee |
From: Mike S. <m...@pe...> - 2007-06-29 00:45:27
|
On Thu, 28 Jun 2007, Berg, Eric wrote: > Are there any best practices, examples, etc. for the best way to > provide a wrapper to log? Here's a couple of hints: http://log4perl.sourceforge.net/d/Log/Log4perl.html#6acb7 > I'm using some of the sample code that provides a _get_logger() > function that derives the category based on the package from which > it's called Isn't that already provided by __PACKAGE__? > , but I've created a problem for myself when it's in an inherited > class in a subclass called in a subclass -- my wrapper is set up to > provide _get_logger() as an inherited method -- because if I define > a method in a superclass, and it's called in a subclass, then I can't > just enable logging for the method in the superclass, because it's the > package name of the subclass from which the category is derived. Hmm, any reason why you aren't simply using Log4perl's get_logger()? > So, to reiterate, I have a class hierarchy, and the top-level class is > the one that does a > > use base qw(My::Logger); > > Then, when one of my subclasses calls _get_logger(), it creates a logger > with the category of the subclass, whereas at least sometimes I want to > enable logging for that inherited method whenever it's called. Just to clarify: Is this your application or your logger class hierarchy? If the former, it shouldn't be a subclass of Logger. If the latter, you probably want to use L4p's get_logger() and pass it the category you want. > Another solution would be wildcard/regex categories. Can we do that? What's the problem you're trying to solve there? -- Mike Mike Schilli m...@pe... > > Thanks! > > -Eric. > > -----Original Message----- > From: Mike Schilli [mailto:m...@pe...] > Sent: Thursday, June 28, 2007 7:54 PM > To: Berg, Eric > Cc: log...@li... > Subject: Re: [log4perl-devel] When a missing config file > > On Thu, 28 Jun 2007, Berg, Eric wrote: > > > I've been looking for a way to get l4p to tell me where the config > > under which it's running comes from. Essentially, I'd like to have a > > method that would return the full path to the config file that it's > > currently using. > > > > Obviously, there are complications, such as those relating to > > programatic configuration subsequent to loading configs from a file, > > in-line, and config (ini) files, but I could find nowhere that the > > file name passed in to init() is retrievable. > > The name of the file isn't stored usually, since you can not only use a > file but a string, a hashref, an URL, etc. to initialize L4p. > > Since you're calling init() in the first place, wouldn't it be easier to > store the filename in your application instead? > > -- Mike > > Mike Schilli > m...@pe... > > > > > -Eric. > > > > -----Original Message----- > > From: log...@li... > > [mailto:log...@li...] On Behalf Of > > John ORourke > > Sent: Thursday, June 28, 2007 6:42 AM > > To: Lee Goddard > > Cc: log...@li... > > Subject: Re: [log4perl-devel] When a missing config file > > > > Try putting: > > > > use Error; > > > > in one of your modules/scripts - it will override the warn/die > > handlers globally, so unless Log4perl overrides them again it will > > give you a stack trace. > > > > cheers > > John > > > > Lee Goddard wrote: > > > > > > Please could Log/Log4perl/Config.pm line 619 offer a stack backtrace > > > > as well as barfing? > > > > > > My current project has four config files, several potential > > > initialisers (bad idea, I know) and reports only via e-mail, since > > > it is part of a MTA process. > > > > > > Thanks in anticipation > > > > > > Lee > > > > > > > > > > > > > > > > > > # The Postfix program > > > > > > # > > > > > > # <tq...@uk...>: Command died with status 2: > > > "perl > > > > > > # -I/home/lgoddard/trafficjam/trunk/lib > > > -MTrafficJam::Controller::Root -e > > > > > > # 'warn TrafficJam::Controller::Root->mail_in'". Command output: > > > Cannot open > > > > > > # config file '/home/lgoddard/trafficjam/trunk/config/mail.l4p' > at > > > > > > # /usr/local/share/perl/5.8.4/Log/Log4perl/Config.pm line 619, > > > <STDIN> line > > > > > > # 26. > > > > > > # > > > > > > > > > > > > Lee Goddard > > > > > > Senior Software Developer > > > > > > Advertising.com, London > > > > > > > > > > > > P Think of the environment before you print this email > > > > > > > > > > > > -------------------------------------------------------------------- > > > -- > > > -- > > > > > > -------------------------------------------------------------------- > > > -- > > > --- This SF.net email is sponsored by DB2 Express Download DB2 > > > Express > > > > > C - the FREE version of DB2 express and take control of your XML. No > > > > limits. Just data. Click to get it now. > > > http://sourceforge.net/powerbar/db2/ > > > -------------------------------------------------------------------- > > > -- > > > -- > > > > > > _______________________________________________ > > > log4perl-devel mailing list > > > log...@li... > > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > > > > > > > > ---------------------------------------------------------------------- > > -- > > - > > This SF.net email is sponsored by DB2 Express Download DB2 Express C - > > > the FREE version of DB2 express and take control of your XML. No > limits. > > Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > log4perl-devel mailing list > > log...@li... > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > - - - - - - - - - > > > > This message is intended only for the personal and confidential use of > the designated recipient(s) named above. If you are not the intended > recipient of this message you are hereby notified that any review, > dissemination, distribution or copying of this message is strictly > prohibited. This communication is for information purposes only and > should not be regarded as an offer to sell or as a solicitation of an > offer to buy any financial product, an official confirmation of any > transaction, or as an official statement of Lehman Brothers. Email > transmission cannot be guaranteed to be secure or error-free. > Therefore, we do not represent that this information is complete or > accurate and it should not be relied upon as such. All information is > subject to change without notice. > > > > -------- > > IRS Circular 230 Disclosure: > > Please be advised that any discussion of U.S. tax matters contained > within this communication (including any attachments) is not intended or > written to be used and cannot be used for the purpose of (i) avoiding > U.S. tax related penalties or (ii) promoting, marketing or recommending > to another party any transaction or matter addressed herein. > > > > > > > > ---------------------------------------------------------------------- > > --- This SF.net email is sponsored by DB2 Express Download DB2 Express > > > C - the FREE version of DB2 express and take control of your XML. No > > limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > log4perl-devel mailing list > > log...@li... > > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. > > -------- > IRS Circular 230 Disclosure: > Please be advised that any discussion of U.S. tax matters contained within this communication (including any attachments) is not intended or written to be used and cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein. > > > |