logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Farquhar <sc...@atlassian.com>
Subject Re: Log4j writes to multiple log files (Additivity problems?)
Date Sat, 27 Apr 2002 00:19:25 GMT
This line:

log4j.additivity.category.default=false

should be this instead:

log4j.additivity.default=false

Similar for the other additivity lines.


Cheers,
Scott

Ashwin Bangalore wrote:
> Hello Log4J Gurus,
> 
> I have a bit of a problem with Log4J writing into multiple log files.
> I searched the mailing list for a similar problem/solution but I've
> either missed it somewhere or didn't find an exact problem posted.
> I did read the fine manual, How-to and the troubleshooting guide also.
> *grin*
> 
> Let me explain a little about what I'm trying to do:
> I have three classes GrandParent, Parent and Child. All three of them
> are individually configured and write to their own log files.
> The additivity of all the three are explicitly set to false.
> The problem is that if the Child writes a log entry, the entry is written
> to all the three log files - Child.log, Parent.log and GrandParent.log.
> 
> I know I'm goofing up somewhere in defining categories, but I just can't
> figure out where. Can someone please help me troubleshooting this problem?
> 
> Will the fact that I have aliased MyFileAppender thrice play a part in
> writing multiple times? I can give you more details about the extended
> classes if anyone requires.
> 
> Pardon me if this has been answered before and kindly point me to
> the correct resources.
> 
> Thanks for your help.
> 
> Ashwin.
> 
> My log4j.properties looks something like this:
> ============Begin Properties file=========================
> log4j.appender.SyslogAppender=com.abc.sle.logging.SLESyslogAppender
> log4j.appender.SyslogAppender.Threshold=FATAL
> 
> log4j.appender.default=com.abc.sle.logging.MyFileAppender
> log4j.appender.GParentAppender=com.abc.sle.logging.MyFileAppender
> log4j.appender.ParentAppender=com.abc.sle.logging.MyFileAppender
> log4j.appender.ChildAppender=com.abc.sle.logging.MyFileAppender
> 
> log4j.appender.default.layout=org.apache.log4j.PatternLayout
> log4j.appender.GParentAppender.layout=org.apache.log4j.PatternLayout
> log4j.appender.ParentAppender.layout=org.apache.log4j.PatternLayout
> log4j.appender.ChildAppender.layout=org.apache.log4j.PatternLayout
> 
> log4j.appender.default.layout.ConversionPattern=[%p] %d %m %n
> log4j.appender.GParentAppender.layout.ConversionPattern=[%p] %d %m %n
> log4j.appender.ParentAppender.layout.ConversionPattern=[%p] %d %m %n
> log4j.appender.ChildAppender.layout.ConversionPattern=[%p] %d %m %n
> 
> log4j.appender.default.Append=true
> log4j.appender.GParentAppender.Append=true
> log4j.appender.ParentAppender.Append=true
> log4j.appender.ChildAppender.Append=true
> 
> log4j.appender.default.File=default.log
> log4j.appender.GParentAppender.File=GParent.log
> log4j.appender.ParentAppender.File=Parent.log
> log4j.appender.ChildAppender.File=Child.log
> 
> log4j.category.default=DEBUG, default, SyslogAppender
> log4j.category.GParent=DEBUG, GParentAppender, SyslogAppender
> log4j.category.Parent=DEBUG, ParentAppender, SyslogAppender
> log4j.category.Child.DEBUG, ChildAppender, SyslogAppender
> 
> log4j.additivity.category.default=false
> log4j.additivity.category.GParentAppender=false
> log4j.additivity.category.ParentAppender=false
> log4j.additivity.category.ChildAppender=false
> 
> ====================== End Properties File =======================
> 
> Notes:
> MyFileAppender is a simple extension of org.apache.log4j.FileAppender
> SyslogAppender is a simple extension of AppenderSkeleton. Calls a custom
> Syslog API also written in Java.
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>
> 
> 


-- 
Scott Farquhar :: scott@atlassian.com

Atlassian :: http://www.atlassian.com
      Supporting YOUR J2EE World



--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message