|
From: Tod H. <th...@gi...> - 2004-10-18 14:10:40
|
OK, here's what I've discovered in my research, using essentially your
example:
There are at least 3 different documented ways to define a logging category
1) log4perl.categoryname = ...
2) log4perl.category.categoryname = ...
3) log4perl.logger.categoryname = ...
and as well at least 2 ways of defining the root logger (maybe others
work as well....).
1) log4perl.rootLogger = ....
2) log4perl.logger = ...
Method 1 of defining a category does not work, at least not on my system!
Method 2 does work
Method 3 I haven't tested
And as for the root logger, method 1 works and method 2 may work but
doesn't seem to work in all cases, though I didn't explore that enough
to be sure
of exactly what was going on.
So the upshot is that between the manual, other pod files for Appenders,
etc, and the tutorial(s) there are some errr discrepencies.
Anyway, thanks for the help, now all I have to conquer is 'additivity'
(which it seems to me for most simple applications the default aught to
be the opposite, but whatever
thats just my personal preference). Thanks again.
>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...
>
>
|