On Jan 7, 2009, at 9:27 AM, Luciano Izquierdo wrote:
Hi, i have a problem, and i want know if somebody can i help me.
I have two appenders
Appender1
And
Appender2
And have one logger
Logger1
I want to do, that all messege debug, info, warn, error and fatal,
will
write in de appender 1.
But also I want to do that only the ERROR message will write in the
appender
2.
How does to do this configuration in the properties file?
Plese help me!
What you want to accomplish is:
Attach both appenders to the root logger, set the level for the root
to debug and set the threshold of appender2 to ERROR.
log4j.rootLogger=DEBUG,Appender1,Appender2
log4j.appender.Appender2.threshold=ERROR
....
The only difference from your description is that both ERROR and FATAL
messages will go to Appender2. If you really only wanted ERROR, you
could apply a filter to Appender2, but that is more complicated and
likely this solution is sufficient.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]