logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Trindade <ricardo.trind...@emation.pt>
Subject multiple logger hierarchies
Date Mon, 15 Nov 2004 08:52:11 GMT

    I'm trying to configure multiple logger hierarchies, and having a 
bit of trouble.

    I tried the following :

        JoranConfigurator logConfigurator = new JoranConfigurator();

        InputStream logConfig = getClass().getResourceAsStream("log4j.xml");
        org.apache.log4j.Logger logger = 
        Hierarchy repository = new Hierarchy(logger);
        logConfigurator.doConfigure(logConfig, repository);

        InputStream anotherLogConfig = 
        org.apache.log4j.Logger anotherLogger = 
        Hierarchy anotherLogRepository = new Hierarchy(anotherLogger);
        logConfigurator.doConfigure(anotherLogConfig , 
anotherLogRepository );

        anotherLogger.debug("something happended!!!!");
        logger.debug("something happended!!!!");  

    which didn't work well. Specifically, both hierarchies appear to 
begin with a logger that has the same default logger as it's parent. I 
would like a different root logger in each category, not descending from 
the default logger. is this possible ?

    Could repository selectors help me ?


To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message