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 Re: multiple logger hierarchies
Date Mon, 15 Nov 2004 09:08:30 GMT
Forgot to mention that I'm using log4j-1.3, with a CVS checkout about 1 
month ago.

thanks
Ricardo

Ricardo Trindade wrote:

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


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