You're already inheriting the "stdout" and "base" appenders from the root
logger. Don't re-define these on your child loggers unless additivity is
turned off, which it is not. Additivity does not apply to appenders, it
applies to loggers, e.g.,....
log4j.additivity.com.fnfbook=false
I would think twice about additivity, though. Why do you need it? I think
you are using it here in a desperate attempt to get logging going to the right
places without really understanding what it is to be used for. Just don't
define "stdout" and "base" on your child loggers and see how things go before
attempting to use additivity. I would guess that right now you are getting
each logger statement logged twice because of the duplicate appender
definitions. I think that's the real issue you are trying to get rid of here,
no?
Jake
On Sun, 27 Sep 2009 19:23:44 -0400
Pat Farrell <[email protected]> wrote:
I think my configuration is a bit off. While the loggers for the
specific classes work fine, everything is also being logged to the root
logger, and I have "additivity" off.
Or at least, I think its off properly.
Could someone take a look and see what I'm doing wrong?
Thanks
Pat
== log4j.properties ====
# in app
### direct log messages to stdout ###
log4j.additivity.default=false
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L
- %m%n
log4j.appender.base=org.apache.log4j.FileAppender
log4j.appender.base.File=/tmp/root.log
log4j.appender.base.layout=org.apache.log4j.PatternLayout
log4j.appender.base.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L -
%m%n
log4j.appender.fnfbookfile=org.apache.log4j.FileAppender
log4j.appender.fnfbookfile.File=/tmp/fnfbook.log
log4j.appender.fnfbookfile.layout=org.apache.log4j.PatternLayout
log4j.appender.fnfbookfile.layout.ConversionPattern=%d{ABSOLUTE} %5p
%c{1}:%L - %m%n
log4j.additivity.fnfbookfile=false
log4j.appender.pat=org.apache.log4j.FileAppender
log4j.appender.pat.File=/tmp/pat.log
log4j.appender.pat.layout=org.apache.log4j.PatternLayout
log4j.appender.pat.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.additivity.pat=false
log4j.rootLogger=INFO, stdout, base
#log4j.rootLogger=DEBUG, stdout, base
log4j.rootLogger.layout=org.apache.log4j.PatternLayout
log4j.rootLogger.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.logger.com.fnfbook=DEBUG, stdout, fnfbookfile
log4j.logger.com.pfarrell=DEBUG, stdout, pat
log4j.logger.org.bibeault=DEBUG, stdout, pat
#log4j.logger.org.bibeault=INFO, stdout, base
--
Pat Farrell
http://www.pfarrell.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]