From: Mike S. <m...@pe...> - 2004-10-15 17:36:27
|
On Fri, 15 Oct 2004, Tod Harter wrote: > OK, basically what I have is mod_perl handlers, so its a bit tough to > call it a 'program', there is > no main application. That's fine. > The behaviour I get with the test is exactly consistent with my > application. I have 1 appender which I use SYNCER, so everything goes to > one log file. It appears that if I set up category 'MyTest' to 'DEBUG' > then even if rootLogger is 'FATAL' I get the messages from MyTest and > MyTest.detail, which is what I would expect (assuming they are both set > at level 'DEBUG'). That's what I would expect, too. But are you sure you want to use a sub category ".detail"? Seems like controlling the output via log levels when calling the logging functions ($log->debug(...), $log->error(...)) would be easier. > But if I set MyTest to 'INFO' I don't even get the > informational message logged at that category at level INFO!!! And I > certainly never get level MyTest.detail unless MyTest is at DEBUG. Your L4p configuration file seems to contain a syntax error: log4perl MyTest.detail (dot missing) > It appears that get_logger() ignores its argument and just uses package > names as categories all the time. I'd be very surprised if that was true. Here's a test case that works: use Log::Log4perl qw(get_logger); my $conf = q( log4perl.rootLogger = INFO, Screen log4perl.category.Bar = DEBUG, Screen log4perl.category.Bar.Twix = DEBUG, Screen log4perl.appender.Screen = Log::Log4perl::Appender::Screen log4perl.appender.Screen.layout = Log::Log4perl::Layout::SimpleLayout ); Log::Log4perl::init(\$conf); my $logger = get_logger("Bar::Twix"); $logger->debug("Message to Bar::Twix"); my $barlogger = get_logger("Bar"); $barlogger->debug("Message to Bar"); Can you provide a simple case like this, confirming what you're suspecting? -- Mike Mike Schilli m...@pe... |