[log4perl-devel] easy_init problem

2008-08-19 Thread Andrew
As I understand it, calling the following:

Log::Log4perl->easy_init({ level   => $DEBUG },
  { level   => $INFO,
file=> ">> log.log" });

should create two loggers, the first logging DEBUG and up messages to 
stderr and the second logging INFO and up to a file called log.log.

While this does create two loggers, one logging to stderr and one to a 
file, both loggers get whatever level is set last, no matter how I 
arrange this list of hashes.

Any idea what's going on here? I'm using Log4perl 1.17.

Here's a simple script showing this behavior:

#! /usr/bin/perl
use strict;
use warnings;

use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init({ level   => $DEBUG },
  { level   => $INFO,
file=> ">> log.log" });

my $log = Log::Log4perl::get_logger();
$log->debug("debug line");
$log->info("info line");


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
log4perl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/log4perl-devel


[log4perl-devel] Log::Log4perl conundrum

2010-04-20 Thread Andrew Whatson
Hi list,

I've been using Log::Log4perl in my application for a few months now and quite
appreciate its flexibility.  There is one simple issue that I can't quite
work out, however...

How would one create a logging setup that will log:
 - all TRACE messages to a log file
 - all INFO messages to the screen

My understanding is that these would need to be appenders on the root logger
in order to catch all messages, however there can only be one log level set
for the logger.  There's no way that I can see to set the log level per
appender, or to have two root loggers with different log levels.

I'm sure there must be some way to do it!

Thanks in advance,
Andrew

--
___
log4perl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/log4perl-devel