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: Kevin G. <ke...@go...> - 2003-10-22 11:27:46
|
> 1) I'd like to have optional parameters to logging statements. The > documentation says that if it lacks a parameter, it will just be > replaced by the undef value. But I got a different behaviour. > > log4perl.appender.dbLog.sql=INSERT INTO log (category, level, customer, message, details) VALUES (?, ?, ?, ?, ?) > log4perl.appender.dbLog.params.1 = %c > log4perl.appender.dbLog.params.2 = %p > log4perl.appender.dbLog.params.3 = %X{customer} > > # execute called with 4 bind variables, 5 needed at > # /usr/local/lib/perl5/site_perl/5.8.0/Log/Log4perl/Appender/DBI.pm line 96. > > $logger->error( > "Some other thing wrong." > ); That's a plain old bug you found. The way it's coded now, missing parameters will be replaced by undef ONLY if they come before the highest declared parameter number in the config, i.e. if you changed the config file to look like this you should get what you want. log4perl.appender.dbLog.sql=INSERT INTO log (category, level, message, details, customer) VALUES (?, ?, ?, ?, ?) log4perl.appender.dbLog.params.1 = %c log4perl.appender.dbLog.params.2 = %p log4perl.appender.dbLog.params.5 = %X{customer} A bad assumption on my part in the code. Fixing it is going to take some thought, so try that workaround rather than waiting for me to patch. On another note, does the test t/034DBI.t pass with your version of the postgres dbd? I noticed it fails with mine, it looks like there was a bug in the dbd that was only fixed in March (http://gborg.postgresql.org/pipermail/dbdpg-general/2003-March/000038.html). -- Happy Trails. . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510)525-5217 |
From: Mike S. <msc...@ao...> - 2003-10-22 11:27:00
|
Hi all, thanks to Scott Deboy from the Chainsaw team, Log::Log4perl 0.39's new socket appender and Guido Carls' XMLLayout, Log::Log4perl can now be used to send events to log4j's graphical log UI, Chainsaw. Here's how it works: http://log4perl.sourceforge.net/releases/Log-Log4perl/docs/html/Log/Log4perl/FAQ.html#can_i_use_log__log4perl_with_log4j's_chainsaw Chainsaw is currently under heavy development, if you have problems getting it installed, just keep nagging Scott, he's a helpful guy :) -- -- Mike Mike Schilli m...@pe... |
From: Kevin G. <ke...@go...> - 2003-10-22 06:15:32
|
> 2) ...when a value from %X is not initialized, > the string '[undef]' is inserted, but when the corresponding database > column is of type INTEGER, obviously the SQL statements fails. I'd like > to have a way to put a zero or a NULL value instead of the string > '[undef]'. Hey, Mike, that's this bit from MDC.pm: if(exists $MDC_HASH{$key}) { return $MDC_HASH{$key}; } else { return "[undef]"; } Do you remember the rationale for returning a string instead of just undef? Maybe we should at least make that configurable? What do you think? -- Happy Trails. . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510)525-5217 |
From: Alex M. <ale...@cl...> - 2003-10-21 10:15:17
|
On Mon, Oct 20, 2003 at 01:28:04PM -0700, Kevin Goess wrote: > >I wonder if there is a way, using Log::Log4perl::Appender::DBI, to set a > >value for a logger, which will be inserted at all subsequent log > >statements. > > See 'Mapped Diagnostic Context' in the perldoc > http://log4perl.sourceforge.net/releases/Log-Log4perl/docs/html/Log/Log4perl.html#mapped_diagnostic_context_(mdc) > > > >my $logger = Log::Log4perl::get_logger(); > > > >my $customer = get_cust_id(); > > #stash the value in a global location for the logger to find > Log::Log4perl::MDC->put('customer', $customer); > > >do_something_dangerous() || $logger->error("Big problem !"); > ># ... > >do_something_uncredibly_dangerous() || $logger->error("Aaargh !"); > > And set up your appender to look like something this: > > log4j.appender.DBAppndr.sql = \ > insert into logtable \ > (custid, message) \ > values (?,?) > log4j.appender.DBAppndr.params.1 = %X{customer} > > Does that answer your question? That's great ! Well, I have a couple of more questions :) 1) I'd like to have optional parameters to logging statements. The documentation says that if it lacks a parameter, it will just be replaced by the undef value. But I got a different behaviour. 2) I would like to do some preprocessing before the value are inserted in the database. I can manage to do that on %x's values by overriding the log() method (and I think I could use this trick to solve the problem #1). But I don't know how to do it on the values in %X. I'd like to do that because when a value from %X is not initialized, the string '[undef]' is inserted, but when the corresponding database column is of type INTEGER, obviously the SQL statements fails. I'd like to have a way to put a zero or a NULL value instead of the string '[undef]'. Here are pieces of code in order to explain my problems : ################################################################################ package MyAppender; use base 'Log::Log4perl::Appender::DBI'; sub log { # Here I'm subclassing to modify value from the %x's parameters my $self = shift; my %p = @_; # Categories are shown as Perl packages $p{log4p_category} =~ s/\./::/g; Log::Log4perl::Appender::DBI::log($self, %p); } 1; ################################################################################ package My::Cute::Package; my $log_conf = <<END; log4perl.appender.dbLog=MyAppender log4perl.appender.dbLog.datasource=dbi:Pg:dbname=test log4perl.appender.dbLog.username= log4perl.appender.dbLog.password= log4perl.appender.dbLog.sql=INSERT INTO log (category, level, customer, message, details) VALUES (?, ?, ?, ?, ?) log4perl.appender.dbLog.params.1 = %c log4perl.appender.dbLog.params.2 = %p log4perl.appender.dbLog.params.3 = %X{customer} log4perl.appender.dbLog.usePreparedStmt = 1 log4perl.appender.dbLog.layout = Log::Log4perl::Layout::NoopLayout log4perl.appender.dbLog.warp_message = 0 log4perl.logger=DEBUG, dbLog END use Log::Log4perl; Log::Log4perl->init(\$log_conf); my $logger = Log::Log4perl::get_logger(); # This one fails with the following message because the database wants an # integer (or a NULL value). # # DBD::Pg::st execute failed: ERROR: pg_atoi: error in "[undef]": can't parse # "[undef]" at /usr/local/lib/perl5/site_perl/5.8.0/Log/Log4perl/Appender/DBI.pm $logger->error( "Something wrong.", "A problem has happened because of this and that." ); # %X{customer} is initialized Log::Log4perl::MDC->put('customer', 1234); # This one works $logger->error( "Something wrong.", "A problem has happened because of this and that." ); # This one fails with the message : # # execute called with 4 bind variables, 5 needed at # /usr/local/lib/perl5/site_perl/5.8.0/Log/Log4perl/Appender/DBI.pm line 96. $logger->error( "Some other thing wrong." ); ################################################################################ -- Alex Marandon CLARISYS Informatique http://clarisys.fr |
From: Mike S. <msc...@ao...> - 2003-10-21 08:03:10
|
Hey all, just released Log::Log4perl 0.39 to log4perl.sourceforge.net -- please give it a whirl! Here's the change log: 0.39 * (kg) fixed bug in interaction between Logger::Level and Level::is_valid so that now you can do $logger->level('INFO') instead of just $INFO. * (ms) Added logic for 'composite appenders'. Appenders can now be configured to relay messages to other appenders. Added Log::Log4perl::Appender::Synchronized, an appender guaranteeing atomic logging of messages via semaphores. * (ms) Added basic substitution to PropertyConfigurator. Now you can define variables (like in "name=value") and subsequent patterns of "${name}" will be replaced by "value" in the configuration file. * (kg) Followed Mike's lead and added variable substitution to the DOMConfigurator. * (ms) Added Log::Log4perl::Appender::Socket as a simple Socket appender featuring connection recovery. -- -- Mike Mike Schilli m...@pe... |
From: Mike S. <msc...@ao...> - 2003-10-21 07:06:11
|
Kevin Goess wrote on 10/19/03, 9:28 PM: > I don't know how useful that would be, but I have the feeling we'd be > more compatible if we didn't screen on dots. Makes perfect sense, I've removed the "." restriction, arbitrary variable names are permitted now. Also, I seem to have picked up the term "basic substitution" from an insular mailing list posting, but you're right, everywhere else it's simply known as "variable substitution" :). -- -- Mike Mike Schilli m...@pe... |
From: Kevin G. <ke...@go...> - 2003-10-20 21:33:11
|
> I wonder if there is a way, using Log::Log4perl::Appender::DBI, to set a > value for a logger, which will be inserted at all subsequent log > statements. See 'Mapped Diagnostic Context' in the perldoc http://log4perl.sourceforge.net/releases/Log-Log4perl/docs/html/Log/Log4perl.html#mapped_diagnostic_context_(mdc) > my $logger = Log::Log4perl::get_logger(); > > my $customer = get_cust_id(); #stash the value in a global location for the logger to find Log::Log4perl::MDC->put('customer', $customer); > do_something_dangerous() || $logger->error("Big problem !"); > # ... > do_something_uncredibly_dangerous() || $logger->error("Aaargh !"); And set up your appender to look like something this: log4j.appender.DBAppndr.sql = \ insert into logtable \ (custid, message) \ values (?,?) log4j.appender.DBAppndr.params.1 = %X{customer} Does that answer your question? -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: Alex M. <ale...@cl...> - 2003-10-20 15:48:45
|
Hello, I wonder if there is a way, using Log::Log4perl::Appender::DBI, to set a value for a logger, which will be inserted at all subsequent log statements. Maybe an exemple will help me to be understandable : ################################################################################ my $logger = Log::Log4perl::get_logger(); my $customer = get_cust_id(); do_something_dangerous() || $logger->error("Big problem !", $customer); # ... do_something_uncredibly_dangerous() || $logger->error("Aaargh !", $customer); ################################################################################ As you can see, I pass the same value as a second argument to several statements, breaking the rule of once-and-only-once. I'm looking for a way to affect values onces to my $logger, and then this values will be inserted in the database for each call to logging statements. Any idea ? -- Alex Marandon CLARISYS Informatique http://clarisys.fr |
From: Kevin G. <ke...@go...> - 2003-10-20 04:36:32
|
Mike, looking at the variable substitution stuff, when the PropertyConfigurator is reading the config file it decides if it's looking at a variable definition if the string on the left of the equals sign doesn't contain a dot: if($key !~ /\./) { But looking at the java stuff, it looks like the java people are rather used to putting dots into their variable names, for instance from their docs: if java.home system property is set to /home/xyz, then every occurrence of the sequence ${java.home} will be interpreted as /home/xyz I gather from the source of OptionConverter.java, (see findAndSubst()) that they treat the *entire* config file as a source of possible substitutions and don't distinguish between substitution-variable definitions and loggers and appenders and stuff. I don't know how useful that would be, but I have the feeling we'd be more compatible if we didn't screen on dots. What do you think? -- Happy Trails. . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510)525-5217 |
From: King, J. X -N. <Jam...@di...> - 2003-10-18 02:11:10
|
I upgraded Perl to version 5.8....still not able to load the Log4. =20 =20 PPM - Programmer's Package Manager version 3.1. Copyright (c) 2001 ActiveState SRL. All Rights Reserved. =20 Entering interactive shell. Using Term::ReadLine::Stub as readline library. =20 Type 'help' to get started. =20 ppm> repository add http://log4perl.sourceforge.net/ppm Repositories: [1] ActiveState PPM2 Repository [2] ActiveState Package Repository [3] Autonamed 1 [4] Autonamed 2 ppm> install Log::Log4perl Searching for 'Log::Log4perl' returned no results. Try a broader search first. ppm> |
From: King, J. X -N. <Jam...@di...> - 2003-10-18 01:41:30
|
I saw your message recently relating to "no ppd". I am getting the same error and I'm using build 635. =20 C:\Disney On-Line\Apps\Perl>ppm install "http://log4perl.sourceforge.net/ppm/Log -Log4perl.ppd" Installing package 'http://log4perl.sourceforge.net/ppm/Log-Log4perl.ppd'... Error installing package 'http://log4perl.sourceforge.net/ppm/Log-Log4perl.ppd': Could not locate a PPD file for package http://log4perl.sourceforge.net/ppm/Log -Log4perl.ppd =20 I've tried it with no quotes, single quotes and still the same response. Is there another way to install the package? Thanks, - James =20 System Engineer |
From: Kevin G. <ke...@go...> - 2003-10-18 01:01:00
|
Mike Schilli wrote: > Just checked in two exciting new features: Variable Substitution in the > conf file (the main man page now contains a section on it) Nice work, Mike. The log4j folks also allow substitution using system variables (-D arg to the JVM). Did you think about doing variable substitution for environment variables, our closest equivalent? If we did that, we could add variable substition to the XML DOMConfigurator as well--the DTD doesn't have a spot for defining substition variables so that's the only way to do it on that side. -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: Mike S. <msc...@ao...> - 2003-10-17 06:29:37
|
Jim Cromie wrote on 10/16/2003, 10:15 PM: > as of 0.37, there is a use 5.006 clause, and there are a lot of uses > for 'our' variables, > which IIRC is a 5.6 feature. That's taken care of. No manual interaction is required. Here's how this works: If you're running perl 5.005_03 and start the standard installation procedure via perl Makefile.PL it will detect that you're running 5.005_03 and will adapt the distribution for 5.005_03 accordingly. In fact, it will take out all 'our' variables and clear the 'use' statements - try it. -- -- Mike Mike Schilli m...@pe... |
From: Jim C. <jc...@di...> - 2003-10-17 05:14:50
|
Mike Schilli wrote: > King, James X -ND wrote on 10/16/2003, 6:24 PM: > >> Excellent product. It has taken me months to build a logger similar >> to this. I would like to convert, however does log4perl support a >> Solaris 5.6 environment running a 5.005.03 version of Perl? >> > Thanks! We're actively supporting 5.005_03 and Solaris. Give it a try > and run the huge test suite that comes with it! > as of 0.37, there is a use 5.006 clause, and there are a lot of uses of 'our' variables, which IIRC is a 5.6 feature. [jimc@harpo jimc]$ perldoc -m Log::Log4perl |grep -n use 5:use 5.006; that said, Mike is certainly 'qualified' to current development efforts ;-), and 0.38 may have already been released (I havent watched closely lately) you might just try to comment out the use 5.006 and the use strict, and see what happens. Id have given a perl -pi.bak -e one-liner, but multiline declarations would defeat the line-at-a-time operation of -p in this context. our %ALLOWED_CODE_OPS = ( 'safe' => [ ':browse' ], 'restrictive' => [ ':default' ], ); FYI, since youre looking to convert an existing code-base to use this shiny new module, you should look into wrapping it in an adaptor class. Log4perl has support for it, its really simple to use, I did so in <shameless plug> Log::Log4perl::AutoCategorize, now on CPAN. My module uses features from 5.8.0, so its not directly useful for your needs. # set this to '1' if you're using a wrapper # around Log::Log4perl our $caller_depth = 0; (all code-quotes are from same file, as on prompt above) |
From: Mike S. <msc...@ao...> - 2003-10-17 04:02:05
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> </head> <body> <font face="Arial,sans-serif"><font size="2"><span type="cite">King, James X -ND wrote on 10/16/2003, 6:24 PM:</span> </font></font> <p><font face="Arial,sans-serif" size="2"></font></p> <blockquote type="cite" ><font face="Arial,sans-serif" size="2"></font> <p class="MsoNormal"><font size="2" face="Arial"><span font-family:arial="">Excellent product. It has taken me months to build a logger similar to this. I would like to convert, however does log4perl support a Solaris 5.6 environment running a </span></font><font size="2" face="Courier New"><span>5.005.03 version of Perl?</span></font></p> <font face="Arial,sans-serif" size="2"></font> <p class="MsoNormal"><font size="2" face="Courier New"><span font-family="" courier="" new="" '=""></span></font></p> </blockquote> <font face="Arial,sans-serif"><font size="2">Thanks! We're actively supporting 5.005_03 and Solaris. Give it a try and run the huge test suite that comes with it!<br> <br> <span>-- <br> -- Mike<br> Mike Schilli<br> <a class="moz-txt-link-abbreviated" href="mailto:m...@pe...">m...@pe...</a></span></font></font> </body> </html> |
From: Mike S. <msc...@ao...> - 2003-10-17 03:59:46
|
Just checked in two exciting new features: Variable Substitution in the conf file (the main man page now contains a section on it) and a Log::Log4perl::Appender::Socket appender, sending messages over the network. Check it out and let me know how you like it! (If all goes well, both are going to be in the upcoming 0.39 release). -- -- Mike Mike Schilli m...@pe... |
From: King, J. X -N. <Jam...@di...> - 2003-10-17 01:27:55
|
Excellent product. It has taken me months to build a logger similar to this. I would like to convert, however does log4perl support a Solaris 5.6 environment running a 5.005.03 version of Perl? Thanks, - James King Software Engineer |
From: Mike S. <msc...@ao...> - 2003-10-14 06:40:06
|
Schmidtchen, Jens wrote on 10/13/2003, 11:00 PM: > well, but specifying: > > log4perl.logger.app = DEBUG, A0 > log4perl.logger.app.cache = DEBUG, A1 > log4perl.logger.app.sql = DEBUG, A1 > log4perl.logger.app.executer = DEBUG, A1 > log4perl.logger.app.dbsession = DEBUG, A1 > > does the same (logs at DEBUG level for both appenders). It shouldn't, if you define your appender filters as we discussed. Here's an example (replaced appenders by screen appenders for simplicity): #!/usr/bin/perl use Log::Log4perl qw(get_logger); Log::Log4perl->init(\<<'EOT'); log4perl.logger.app = DEBUG, A0 log4perl.logger.app.cache = DEBUG, A1 log4perl.logger.app.sql = DEBUG, A1 log4perl.logger.app.executer = DEBUG, A1 log4perl.logger.app.dbsession = DEBUG, A1 # Filter to match level ERROR log4perl.filter.MatchError = Log::Log4perl::Filter::LevelMatch log4perl.filter.MatchError.LevelToMatch = ERROR log4perl.filter.MatchError.AcceptOnMatch = true # Filter to match level DEBUG log4perl.filter.MatchDebug = Log::Log4perl::Filter::LevelMatch log4perl.filter.MatchDebug.LevelToMatch = DEBUG log4perl.filter.MatchDebug.AcceptOnMatch = true # File-Appender log4perl.appender.A0 = Log::Dispatch::Screen log4perl.appender.A0.Filter = MatchDebug log4perl.appender.A0.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.A0.layout.ConversionPattern = %d %p> %F{1}:%L %M - %m%n # DB-Appender log4perl.appender.A1 = Log::Log4perl::Appender::Screen log4perl.appender.A1.Filter = MatchError log4perl.appender.A1.layout = Log::Log4perl::Layout::SimpleLayout EOT my $log = get_logger("app.cache"); $log->error("error msg"); $log->debug("debug msg"); __END__ Let's check the output: ERROR - error msg 2003/10/13 23:14:01 DEBUG> t:38 main:: - debug msg The different layouts show that the error message is logged only by the A0 appender, the debug message is logged only by the A1 appender. > is it important to > mention that "app" is the perl script (*.pl) started at command line > and "cache", "sql", "executer" and "dbsession" are classes (*.pm) > from different > packages (directories) which "app" just uses? they are *NOT* > sub-classes of > "app" but super-classes of several other classes. each class creates > ist own > logger, e.g. my $logger = get_logger('app.executer'). It doesn't matter how your classes relate to each other, only how you define your logger categories. > my goal in general is to log INFO and ERROR messages through the db > appender > (to let my program leave information to its callers). furthermore i > want to > provide an optional second "channel" for debugging purposes (through file > appender) - logging each and every message (including INFO and ERROR). an > additional task of the file logger is to catch errors during > initialization > of db logging too. This is different from what I interpreted your previous request to be. So, you're saying you want to send all (system-wide) INFO+up messages to A0 and DEBUG-only to A1 (as long as the appropriate loggers are firing, of course)? Then you don't need to attach appenders to your sub-category loggers, only to the top one. Also, you need two filters, one levelMatch (to match DEBUG) and one levelRange (INFO through FATAL). Try this: use Log::Log4perl qw(get_logger); Log::Log4perl->init(\<<'EOT'); log4perl.logger.app = DEBUG, A0, A1 log4perl.logger.app.cache = DEBUG log4perl.logger.app.sql = DEBUG log4perl.logger.app.executer = DEBUG log4perl.logger.app.dbsession = DEBUG # Filter to let INFO+up through log4perl.filter.info_and_up = Log::Log4perl::Filter::LevelRange log4perl.filter.info_and_up.LevelMin = INFO log4perl.filter.info_and_up.LevelMax = FATAL log4perl.filter.info_and_up.AcceptOnMatch = true # Filter to match level DEBUG log4perl.filter.MatchDebug = Log::Log4perl::Filter::LevelMatch log4perl.filter.MatchDebug.LevelToMatch = DEBUG log4perl.filter.MatchDebug.AcceptOnMatch = true # File-Appender log4perl.appender.A0 = Log::Dispatch::Screen log4perl.appender.A0.Filter = MatchDebug log4perl.appender.A0.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.A0.layout.ConversionPattern = %d %p> %F{1}:%L %M - %m%n # DB-Appender log4perl.appender.A1 = Log::Log4perl::Appender::Screen log4perl.appender.A1.Filter = info_and_up log4perl.appender.A1.layout = Log::Log4perl::Layout::SimpleLayout EOT my $log = get_logger("app.cache"); $log->error("error msg"); $log->debug("debug msg"); > during my test i 've figured out another challenge: if the db appender is > unable to write to db (lets say due to violated constraints) it throws > messages to STDERR. these messages get neither handled nor logged. i > want to > log them through my file appender and stop execution ... I'll hand this one over to Kevin, he's the DB appender guru :). -- -- Mike Mike Schilli m...@pe... |
From: Mike S. <msc...@ao...> - 2003-10-14 06:20:32
|
-------- Original Message -------- Subject: AW: AW: Taken from http://www.perl.com/pub/a/2002/09/11/log4perl. html ?pag e=3D3 Date: 10/13/2003, 1:57 PM From: "Schmidtchen, Jens" <Jen...@vi...> To: 'Mike Schilli' <msc...@ao...> thanks once again. but - believe it or not - both appenders write DEBUG messages: [Log4Perl] log4perl.logger.app =3D DEBUG, A1, A0 log4perl.logger.app.cache =3D DEBUG, A1, A0 log4perl.logger.app.sql =3D DEBUG, A1, A0 log4perl.logger.app.executer =3D DEBUG, A1, A0 log4perl.logger.app.dbsession =3D DEBUG, A1, A0 # Filter to match level ERROR log4perl.filter.MatchError =3D Log::Log4perl::Filter::LevelMatch log4perl.filter.MatchError.LevelToMatch =3D ERROR log4perl.filter.MatchError.AcceptOnMatch =3D true # Filter to match level DEBUG log4perl.filter.MatchDebug =3D Log::Log4perl::Filter::LevelMatch log4perl.filter.MatchDebug.LevelToMatch =3D DEBUG log4perl.filter.MatchDebug.AcceptOnMatch =3D true # File-Appender log4perl.appender.A0 =3D Log::Dispatch::File log4perl.appender.A0.Filter =3D MatchDebug log4perl.appender.A0.filename =3D sub {getLogFileName();}; log4perl.appender.A0.mode =3D write log4perl.appender.A0.layout =3D Log::Log4perl::Layout::PatternLayout log4perl.appender.A0.layout.ConversionPattern =3D %d %p> %F{1}:%L %M - %m%n # DB-Appender log4perl.appender.A1 =3D Log::Log4perl::Appender::DBI log4perl.appender.A1.Filter =3D MatchError log4perl.appender.A1.datasource =3D sub {getDBName();}; log4perl.appender.A1.username =3D sub {getDBUser();}; log4perl.appender.A1.password =3D sub {getDBPassWd();}; log4perl.appender.A1.sql =3D sub {getSQLStmt();}; # Bind values for Insert Statement log4perl.appender.A1.params.1 =3D %c # Category of the logging event log4perl.appender.A1.params.2 =3D %C # Fully qualified package (or class) name of the caller log4perl.appender.A1.params.3 =3D %d{d.M.yyyy HH:mm:s} # Current date in yyyy/MM/dd hh:mm:ss format log4perl.appender.A1.params.4 =3D %F{2} # File where the logging event occurred log4perl.appender.A1.params.5 =3D %H # Hostname log4perl.appender.A1.params.6 =3D %L # Line number within the file where the log statement was issued log4perl.appender.A1.params.7 =3D %M # Method or function where the logging request was issued log4perl.appender.A1.params.8 =3D %p # Priority of the logging event log4perl.appender.A1.params.9 =3D %r # Number of milliseconds elapsed from program start to logging event log4perl.appender.A1.params.10 =3D %m # The message to be logged log4perl.appender.A1.layout.dontCollapseArrayRefs =3D 1 log4perl.appender.A1.usePreparedStmt =3D 1 log4perl.appender.A1.layout =3D Log::Log4perl::Layout::PatternLayout log4perl.appender.A1.layout.ConversionPattern =3D %d %p> %F{1}:%L %M - %m%n log4perl.oneMessagePerAppender =3D 1 what did i do wrong? can one get an appender catching messages of more than ONE level (e.g. all DEBUG AND ERROR messages)? jens -----Urspr=FCngliche Nachricht----- Von: Mike Schilli [mailto:msc...@ao...] Gesendet: Montag, 13. Oktober 2003 22:11 An: Schmidtchen, Jens Cc: log4perl-devel Betreff: Re: AW: Taken from http://www.perl.com/pub/a/2002/09/11/log4perl.html ?pag e=3D3 Schmidtchen, Jens wrote on 10/13/2003, 12:19 PM: > could you please let me know, if the following can be achieved at all? > assume several (given) classes each of which with their own logger. Ok, that's pretty common. > these > loggers should catch ERRORS only. but in addition all DEBUG messages > should > be caught too and be recorded into another destination. To split output by level, use a custom filter, here's the FAQ: http://log4perl.sourceforge.net/releases/Log-Log4perl/docs/html/Log/Log4perl= =20 /FAQ.html#i_want_to_log_error_and_warn_messages_to_different_files!_how_can_= =20 i_do_that You will need to specify the logger's level equal to the lowest priority of messages, DEBUG in your case, though. > in general: the > level of the uppermost logger is less restrictive than the levels of the > other ones. IMHO the problem is that the uppermost logger can't > receive any > DEBUG message from its descendant since they suppress any non-ERROR > message. This should be taken care of by the configuration outlined above, right? --=20 -- Mike Mike Schilli m...@pe... -- -- Mike Mike Schilli msc...@ao... AOL Unified Preferences Engineering |
From: Mike S. <msc...@ao...> - 2003-10-13 20:15:15
|
Schmidtchen, Jens wrote on 10/13/2003, 12:19 PM: > could you please let me know, if the following can be achieved at all? > assume several (given) classes each of which with their own logger. Ok, that's pretty common. > these > loggers should catch ERRORS only. but in addition all DEBUG messages > should > be caught too and be recorded into another destination. To split output by level, use a custom filter, here's the FAQ: http://log4perl.sourceforge.net/releases/Log-Log4perl/docs/html/Log/Log4perl/FAQ.html#i_want_to_log_error_and_warn_messages_to_different_files!_how_can_i_do_that You will need to specify the logger's level equal to the lowest priority of messages, DEBUG in your case, though. > in general: the > level of the uppermost logger is less restrictive than the levels of the > other ones. IMHO the problem is that the uppermost logger can't > receive any > DEBUG message from its descendant since they suppress any non-ERROR > message. This should be taken care of by the configuration outlined above, right? -- -- Mike Mike Schilli m...@pe... |
From: Mike S. <msc...@ao...> - 2003-10-13 18:51:50
|
Schmidtchen, Jens wrote on 10/13/2003, 11:21 AM: > please tell me: is it right??? > > as far as i have unterstood, DEBUG is a LOWER level than FATAL. how could > the above happen in case root logger catches only FATAL messages but > receives a DEBUG message propagated by Groceries' logger? wouldn't the > root > logger suppress the DEBUG message due to ist low priority? Yep, it's correct. As soon as one logger has decided to fire, the message is bubbling up and will be logged *unconditionally* by any loggers on the way up. If that's not what you want, use appender thresholds as the documentation points out. -- -- Mike Mike Schilli m...@pe... title: "beginner's pitfalls" <quote> Easy enough: Let's set the root logger to FATAL and attach a Log::Dispatch::Screen appender to it. Then, let's set the Groceries logger to DEBUG and attach a Log::Dispatch::File appender to it. Now, if any logger anywhere in the system issues a FATAL message and decides to 'fire,' the message will bubble up to the top of the logger hierarchy, be caught by every appender on the way and ultimately end up at the root logger's appender, which will write it to STDERR as required. Nice. But what happens to DEBUG messages originating within Groceries? Not only will the Groceries logger 'fire' and forward the message to its appender, but it will also percolate up the hierarchy and end up at the appender attached to the root logger. And, it's going to fill up STDERR with DEBUG messages from Groceries, whoa! </quote> please tell me: is it right??? as far as i have unterstood, DEBUG is a LOWER level than FATAL. how could the above happen in case root logger catches only FATAL messages but receives a DEBUG message propagated by Groceries' logger? wouldn't the root logger suppress the DEBUG message due to ist low priority? best regards, jens |
From: Alex M. <ale...@cl...> - 2003-10-13 08:26:09
|
On Fri, Oct 10, 2003 at 11:42:33AM -0700, Mike Schilli wrote: > The suggested workaround is to use configuration file "basic > substitution" (variable substitution), which is currently not available > in Log4perl. But now that I see a need for it, I'll put it right on the > TODO-List :). Great :) > For now, a hack to get what you want is to read in the configuration > file into a Perl string, manipulate it (variable substitution etc.) and > then feed it to init( \$string ). Again, it's a hack. my $life = <<""; That's ok for me, as I'm already loading my configuration this way because the path of my log files is in variables. Thanks for your answer. -- Alex Marandon CLARISYS Informatique http://clarisys.fr |
From: Mike S. <msc...@ao...> - 2003-10-12 01:42:03
|
Januski, Ken wrote on 10/3/03, 12:02 PM: > The Active State version is binary build 631, perl version 5.6.1. I > actually had the FAQ web page up so that I could follow the > instructions as closely as possible. Also did it over and over again. Finally got around to look into this: I downloaded Activestate 5.6.1 (build 635) from their website and then just ran ppm install "http://log4perl.sourceforge.net/ppm/Log-Log4perl.ppd" from the DOS command line, as outlined in the Log4perl instructions. Both download and installation worked fine. So I guess the problem could be related to your Activestate installation. Can you try upgrading to the latest Activestate 5.6.1? That should fix the problem. -- -- Mike Mike Schilli log...@pe... |
From: Mike S. <msc...@ao...> - 2003-10-10 18:44:37
|
Alex Marandon wrote on 10/10/2003, 6:40 AM: > At first, I would like to congratulate log4perl developpers for their > great works. It's really usefull for me. Thanks! > I've seen that it's possible, using the perlish configuration style to > define a layout and to assign it to multiple appenders. But I > don't find how to do the same with the configuration files syntax. Good question -- it has been brought up in the log4j community: http://www.geocrawler.com/archives/3/8711/2001/3/0/5390252/ The suggested workaround is to use configuration file "basic substitution" (variable substitution), which is currently not available in Log4perl. But now that I see a need for it, I'll put it right on the TODO-List :). For now, a hack to get what you want is to read in the configuration file into a Perl string, manipulate it (variable substitution etc.) and then feed it to init( \$string ). Again, it's a hack. -- -- Mike Mike Schilli m...@pe... |
From: Alex M. <ale...@cl...> - 2003-10-10 13:40:43
|
Hello, At first, I would like to congratulate log4perl developpers for their great works. It's really usefull for me. Then I have a question about the configuration file syntax. I've seen that it's possible, using the perlish configuration style to define a layout and to assign it to multiple appenders. But I don't find how to do the same with the configuration files syntax. Any help appreciated. -- Alex Marandon CLARISYS Informatique http://clarisys.fr |