logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Levinson <Stephen.Levin...@sun.com>
Subject RE: Different appenders/layouts for each debug level.
Date Fri, 14 Sep 2001 15:44:43 GMT
This is from the log4j   docs\FAQ.html:


Is it possible to direct log output to different appenders by priority?
Yes it is. Setting the Threshold option of any appender extending
AppenderSkeleton, (most log4j appenders extend AppenderSkeleton) to filter
out all log events with lower priority than the value of the threshold
option. 

For example, setting the threshold of an appender to DEBUG also allow INFO,
WARN, ERROR and FATAL messages to log along with DEBUG messages. (DEBUG is
the lowest priority). This is usually acceptable as there is little use for
DEBUG messages without the surrounding INFO, WARN, ERROR and FATAL messages.
Similarly, setting the threshold of an appender to ERROR will filter out
DEBUG, INFO and ERROR messages but not FATAL messages. 

This policy usually best encapsulates what the user actually wants to do, as
opposed to her mind-projected solution. 

See sort4.lcf for an example threshold configuration. 

If you must filter events by exact priority match, then you can attach a
PriorityMatchFilter to any appender to filter out logging events by exact
priority match. 

--Stephen


-----Original Message-----
From: Carlos Costa Portela [mailto:ccosta@genasys.es]
Sent: Friday, September 14, 2001 5:40 PM
To: LOG4J Users Mailing List
Subject: RE: Different appenders/layouts for each debug level.


On Fri, 14 Sep 2001, Stephen Levinson wrote:

> You can set tracing THRESHOLDS for each appender...

	This sounds like chinese to me (and I am not chinese!) ;-)

	How can I achieve this?. Thank you very much,
		Carlos.


 --
 _________ Carlos Costa Portela ____________ ccosta@genasys.es _____
|       http://ccp.servidores.net         http://www.genasys.es     |
|_Tódalas persoas maiores foron nenos antes, pero poucas se lembran_|


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

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


Mime
View raw message