This content has been marked as final.
Show 1 reply
-
1. Re: Configure log4j; error
luxspes Sep 2, 2009 4:01 PM (in response to chris.simons)Have you tried writing it like this (first define the appender and only then setting is for root):
# STDOUT is STDOUT logging log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d %p [%t] %C{1} - %m%n # A1 is a FileAppender # log4j.appender.A1.Append=true log4j.appender.A1.File=englink-log4j.log log4j.appender.A1.Threshold=INFO log4j.appender.A1=org.apache.log4j.FileAppender log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%-5p [%t] - %m%n # Log4j configuration file. log4j.rootLogger=INFO,A1,stdout # #set level # log4j.logger.com=INFO
Anyway, I recommend you to switch to slf4j integrated with logback, both created by the author of log4j, but much improved (and fully backwards compatible if you need it to be)