> If you use the XML configuration file, you can define a Filter
which
> filters by level. You would then set the Logger's Level to ALL,
and
> specify the levels you want in each Appender you attach.
Or you can use the threshold attribute. This works with the
prop
I think you're mixing the purpose of appenders and levels. If everything is
going to the console, and has the same layout, then you only need one
appender. Then for each package you specify a different level to log at (eg
INFO, DEBUG, ERROR etc). And yes, as Alan said, you can specify a package
n
> Where would you see as being the best place to log this
> Exception? If it gets logged at the lowest layer (methodC), how does the
> next layer up (methodB) know not to log it again, since it can't tell
which
> Exceptions it caused and which were thrown to it. And the same question
Don,
The example below defines 3 appenders with different levels of messages
going to each.
log4j.appender.Console.Threshold=WARN
log4j.appender.ApplicationLog.Threshold=INFO
log4j.appender.ComponentLog.Threshold=DEBUG
# The level for the root logger should be eq
Taner,
In order to use a custom level in the LevelMatchFilter (or pretty much
anywhere), you need to specify the name of your custom class. For example,
instead of
use
Note that the class name specified needs to be fully qualified, so add the
package info after the #.
Simo
e you do not specificy an appender twice.
For your case this could explain everything going to the SysLog appender, if
you have this specified higher in the hierarchy than the other application
log setting.
If this doesnt help, reply with the contents of your property file so we can
help more.