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 jerome moliere <jm...@nerim.net> on 2005/02/22 14:19:49 UTC

Re: converting DEBUG logs to INFO logs by configuration, or by injection of external code

> Hi,
>
Hi dominique,
> we currently have some packaged Java code producing logs with Log4j. A
> specific logger produces very interesting logs in DEBUG level.
>
> We'd  like to have these logs in the normal execution mode of the
> application, but quite logically, we'd also like to set the global Log4j
> threshold to INFO level for more simplicity.
>
> How can we have these specific logs but at the same time be in INFO level
> ?
> Is there a way to convert DEBUG logs of a specific logger in INFO logs
> only
> by configuration or by injection of external code (filters ?), whithout
> changing the business code ?
>
as far as I know, don't see any way to convert your messages from DEBUG to
LEVEl...
log4J supports filters, but it implies that you develop one filter for
this usage & configure its usage...
> Or do you advise to not play with threshold setting but to configure the
> root & then specific loggers one by one ? (not preferred solution)
>
I don't think that you're obliged to such a solution...
> Or there is no better solution than changing the business code ?
>
I guess that you don't want to do this...
> Thank you for all your proposals, we're not sure we've seen all Log4j
> features concerning this.
>
May be that the very interesting feature of additivity could save you much
time...
Just define one (or X loggers) for the package source of the interesting
logs, specify addivity to false, reference an appender (file or any other)
then logs should be output in this file.....
and that 's it

HTH
Jerome
-- 
Auteur cahier du programmeur J2EE - Decembre 2004
http://www.amazon.fr/exec/obidos/ASIN/2212115741/qid=1105361289/sr=1-1/ref=sr_1_8_1/171-9571438-3966654



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