On Wed, 2004-03-31 at 18:13, Oliver Mather wrote: > Hi, > > I need a little help with my log4j configuration files. Any help would be > very much appreciated. > > Is it was possible to configure loggers to log different levels based on > appenders ? > > > For example > ----------------------------------------------- > # I have two appenders FILE and CONSOLE. > log4j.rootLogger=ALL,FILE, CONSOLE > > # For VerboseObj I want CONSOLE to log WARN, and FILE to log INFO > log4j.logger.com.xyz.VerboseObj=INFO > # For QuietObj I want CONSOLE to log INFO, and FILE to log DEBUG > log4j.logger.com.xyz.QuietObj=INFO > > ------------------------------------ > > Any idea how to do this ?
Appenders have an attribute called "threshold", which can be set to a priority. The appender will then ignore any messages of lower priority than the threshold. Note that this is significantly less efficient than the filtering by category so filter out as much stuff as possible using the category priority first. I'm not sure of the exact .properties syntax for setting this; I use xml config files myself. Regards, Simon --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
