Markus,

> is it possible to add appenders to category definitions listening
> to different
> log-levels (sorry if my terminology is awkward)

I have the following configuration:

###################
log4j.rootCategory=error, R, email

#RollingFile Appender setup
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=/www/martec_app_log.txt
log4j.appender.R.MaxFileSize=15KB
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%p] (%t) - %c{2} - %m%n

log4j.appender.email=org.apache.log4j.net.SMTPAppender
log4j.appender.email.Threshold=ERROR
log4j.appender.email.layout=org.apache.log4j.PatternLayout
log4j.appender.email.BufferSize=1
[EMAIL PROTECTED]
log4j.appender.email.SMTPHost=digiworks.tv
log4j.appender.email.Subject=Error in Martec
[EMAIL PROTECTED]
log4j.appender.email.layout.ConversionPattern=%d [%p] (%t) - %c{2} - %m%n

#################

Notice the Threshold, which will only log ERROR or greater to the smtp
appender (and everything to the rolling file appender). I think this should
do the trick for you.

Ylan Segal.





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to