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
Hi,

    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 = 
org.apache.log4j.Logger.getLogger("log");
        Hierarchy repository = new Hierarchy(logger);
        logConfigurator.doConfigure(logConfig, repository);

        InputStream anotherLogConfig = 
getClass().getResourceAsStream("anotherlog.xml");
        org.apache.log4j.Logger anotherLogger = 
org.apache.log4j.Logger.getLogger("anotherlog");
        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 ?

thanks
Ricardo


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


Mime
View raw message