logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Camuto, Matthew" <matthew.cam...@redsealsys.com>
Subject RE: Appenders Problem
Date Wed, 18 May 2005 15:12:55 GMT
If you remove 'emailAppender' from your log4j.rootLogger config then
part of your problem should be fixed. I had a similar situation and used
the following code:

log4j.rootLogger=DEBUG, EXTERNAL

log4j.logger.internal=DEBUG,INTERNAL
log4j.additivity.internal=false

where I defined 2 separate appenders and every logger starting with the
string 'internal.'... would just go to the INTERNAL appender. I think
this
is similar to the problem you have now?

matt


-----Original Message-----
From: Luke [mailto:luke@lukeshannon.com] 
Sent: Wednesday, May 18, 2005 5:32 AM
To: log4j-user@logging.apache.org
Subject: Appenders Problem

Hi All;

I would like to write to a specific file when logging from a specific
class.

Below is my properties file. The class that needs the special behavior
is in the model.notification package. It should be handled with the
emailAppender, which in turn should only write INFO messages to the
email.html file.

But what happens is email.html gets everything and fw.html gets
everything plus some duplicate entries.

What am I doing wrong?

Thanks,

Luke


log4j.rootLogger=debug, generalAppender, emailAppender

#class specific loggin
log4j.category.model.notification=INFO, emailAppender
log4j.additivity.model.notification=false
log4j.category.beans=DEBUG, generalAppender
log4j.category.model=DEBUG, generalAppender
log4j.category.model.writers=DEBUG, generalAppender
log4j.category.servlet=DEBUG, generalAppender

#general appender properties
log4j.appender.generalAppender=org.apache.log4j.DailyRollingFileAppender
log4j.appender.generalAppender.File= //usr/local/tomcat/logs/fw/fw.html
log4j.appender.generalAppender.MaxFileSize=100KB
log4j.appender.generalAppender.DatePattern='.'yyyy-MM-dd
log4j.appender.generalAppender.MaxBackupIndex=3

#email appender properties
log4j.appender.emailAppender=org.apache.log4j.DailyRollingFileAppender
log4j.appender.emailAppender.File= //usr/local/tomcat/logs/fw/email.html
log4j.appender.emailAppender.MaxFileSize=300KB
log4j.appender.emailAppender.DatePattern='.'yyyy-MM-dd
log4j.appender.emailAppender.MaxBackupIndex=3

#general appender layout
log4j.appender.generalAppender.layout=org.apache.log4j.HTMLLayout
log4j.appender.generalAppender.layout.LocationInfo=true
log4j.appender.generalAppender.layout.Title=FW Application Log

#email appender layout
log4j.appender.emailAppender.layout=org.apache.log4j.HTMLLayout
log4j.appender.emailAppender.layout.LocationInfo=true
log4j.appender.emailAppender.layout.Title=FW Email Log 

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message