logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gulcu <...@urbanet.ch>
Subject Re: newbie question
Date Mon, 08 Jan 2001 20:11:50 GMT

This is a classic. Here is an excerpt from the log4j troubleshooting guide 
One other common mistake is to forget that appenders are inherited 
cumulatively from the hierarchy. For example, if you add an appender, say 
A, to the root category, all
other categories will inherit A as an appender. Thus, if you add A to a 
categoy, say C, then an enabled statement of category C, will print to A 
twice, once because A is in
root and once because it is in C.

In your case, the com.intraware.logging.app.trace category is inheriting 
the APP_FILE_LOG and SYSLOG appenders from the  com.intraware.logging.app 
and respectively the com.intraware.logging categories.

You can add a Threshold to APP_FILE_LOG as you have done or set the 
additivity flag of the com.intraware.logging.app.trace category to false. 
This will prevent the com.intraware.logging.app.trace category from 
inheriting appenders from higher in the hierarchy.

The syntax is:


I hope this helps, Ceki

At 11:18 08.01.2001 -0800, you wrote:

>I'm trying to set up log4j (v0.9.1) as follows:
>Category 1 -- com.intraware.logging,                 log ERROR and above
>to syslog  (SYSLOG)
>Category 2 -- com.intraware.logging.app           log WARN and above to
>rolling file. (APP_FILE_LOG)
>Category 3 -- com.intraware.logging.app.trace   log all to STDERR
>With the attached properties file and test program, INFO and DEBUG
>messages  are appended to APP_FILE_LOG.
>Desired behavior occurs when the Threshold option is set
>explicitly by uncommenting:
>          # log4j.appender.APP_FILE_LOG.Threshold=WARN
>Thanks for any help.
>Randy Ballew, Senior Application Architect, Intraware, Inc.
>     925.253.4507
>     rballew@intraware.com
>log4j.appender.SYSLOG.layout.ConversionPattern=[%t] %-5p - %m%n
>log4j.appender.APP_FILE_LOG.layout.ConversionPattern=%d [%t] %-5p - %m%n
>log4j.appender.STDERR.layout.ConversionPattern=%d [%t] %-5p - %m%n
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org

View raw message