You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "James A. N. Stauffer" <st...@gmail.com> on 2008/05/16 23:53:03 UTC

Re: Reading log4j properties dynamically from log4j API

You might want to check how LogWeb does it.

On Tue, Apr 29, 2008 at 11:41 AM, smpub2000 <sm...@yahoo.com> wrote:
>
> I have an ear file that has log4j.properties conf file. I want to get all the
> log4j loggers (i.e categories) defined in the properties file. How can I get
> this through the log4j api?
>
> Example log4j.properties:
>
>
> src packages:
> log4j.category.com.foo=debug
> log4j.category.com.foo.bar=error
>
> I want to get the keys "com.foo" and "com.foo.bar".  I want to use these
> later as arguments to Logger.getLogger("method") and call
> setLevel(targetLevel) on it. If I call LogManager.getCurrentLoggers(), it
> only retrieves the Logger instances created by Classes, but not the
> "package" level loggers that are defined in the log4j.properties file.
>
> Thanks,
> SM.
>
> --
> View this message in context: http://www.nabble.com/Reading-log4j-properties-dynamically-from-log4j-API-tp16964256p16964256.html
> Sent from the Log4j - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>



-- 
James A. N. Stauffer http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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