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 do...@bnpparibas.com on 2005/02/22 14:31:52 UTC

Réf. : Re: converting DEBUG logs to INFO logs byconfiguration, or by injection of external code

Jerome,

when i was suggesting to "configure the root & then specific loggers", i
was basically pointing on the additivity feature. Only the *specific*
concerned loggers are configured in DEBUG level, the root in INFO level.

This is a bug java application where a lot of loggers are present and
configured specifically when investigations are in progress.. Basically,
the production team would like to have only 1 setting to check, the
threshold, and not have several loggers to keep in DEBUG. They would like
to have 1 level of log in the files, when the situation is/comes back to
normal, to "cruise" mode.

Thank you for your answers.


> 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










This message and any attachments (the "message") is
intended solely for the addressees and is confidential. 
If you receive this message in error, please delete it and 
immediately notify the sender. Any use not in accord with 
its purpose, any dissemination or disclosure, either whole 
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message. 
BNP PARIBAS (and its subsidiaries) shall (will) not 
therefore be liable for the message if modified. 

                ---------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le 
"message") sont etablis a l'intention exclusive de ses 
destinataires et sont confidentiels. Si vous recevez ce 
message par erreur, merci de le detruire et d'en avertir 
immediatement l'expediteur. Toute utilisation de ce 
message non conforme a sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf 
autorisation expresse. L'internet ne permettant pas 
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce 
message, dans l'hypothese ou il aurait ete modifie.


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


Re: Réf. : Re: converting DEBUG logs to INFO logs by configuration, or by injection of external code

Posted by jerome moliere <jm...@nerim.net>.
>
> Jerome,
>
> when i was suggesting to "configure the root & then specific loggers", i
> was basically pointing on the additivity feature. Only the *specific*
> concerned loggers are configured in DEBUG level, the root in INFO level.
>
oops sorry!!!

> This is a bug java application where a lot of loggers are present and
> configured specifically when investigations are in progress.. Basically,
> the production team would like to have only 1 setting to check, the
> threshold, and not have several loggers to keep in DEBUG. They would like
> to have 1 level of log in the files, when the situation is/comes back to
> normal, to "cruise" mode.
yes, it's more clear for me...
I guess that a small of code using JavaAssist or any other AOP framework
could make the job but do you plan to have a solution operating on the
code source or at the byte code level ?

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