On Fri, 2004-04-02 at 16:01, Kawthar Bt M Sulaiman wrote: > Hi, > > In this file, there's: > > log4j.rootCategory=debug, MO ----> <first> > > Then, > > log4j.appender.MO=org.apache.log4j.DailyRollingFileAppender > log4j.appender.MO.Threshold=DEBUG. -----> <second> > ... > > My question, is the debug <on first> and <debug on second> has the > same > meaning? So, if I just want to log INFO and above, do I change the > Threashold=INFO only or both?
When some code logs a message, it specifies a priority and a category. If the message priority is less than the category priority, then the message is totally ignored. Once the message gets past that first cutoff, some significant work gets done (creating a LogEvent object etc), then the message is sent on to each appender (ie "outputter") associated with the category. If any of those appenders has a threshold set, then that appender discards (ignores) the message if its priority is less than the threshold. So this allows you to say: * category X has two appenders: file and email * for category X, ignore everything lower than INFO * for the file appender, accept all that pass the category priority (ie no threshold set) * for the email appender, ignore those messages which got past the category filtering, but are lower than WARN It is more efficient to filter at the category level than the appender level, but if you want different amounts of detail written to different appenders for the same category, then the threshold setting allows you to do this. Cheers, Simon --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
