On Wed, 16 Jul 2008, Johannes Kilian wrote:

> probably a simple question, but I cannot figure it out:
>
> I have configured a logger for category "Test" to log all DEBUG messages - 
> but for one child-category "Test.child1" I only want the INFO messages.
>
> What I tried is:
> ---
> log4j.logger.Test=DEBUG, MyFileAppender
> log4j.logger.Test.Child1=INFO, MyFileAppender
>
> log4j.additivity.Test=true
> log4j.additivity.Test.Child1=false

Looks good to me:

    use Log::Log4perl qw(:easy);
    Log::Log4perl->init(\ q{
     log4j.logger.Test=DEBUG, Screen
     log4j.logger.Test.Child1=INFO, Screen

     log4j.additivity.Test=true
     log4j.additivity.Test.Child1=false
     log4j.appender.Screen = Log::Log4perl::Appender::Screen
     log4j.appender.Screen.layout = SimpleLayout
    });

    get_logger("Test")->debug("test debug log");
    get_logger("Test")->info("test info log");

    get_logger("Test::Child1")->debug("child1 debug log");
    get_logger("Test::Child1")->info("child1 info log");

yields

    DEBUG - test debug log
    INFO - test info log
    INFO - child1 info log

Isn't that what you'd expect?

-- Mike

Mike Schilli
[EMAIL PROTECTED]

-------------------------------------------------------------------------
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
log4perl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/log4perl-devel

Reply via email to