Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

log4j log file created but empty!!

807569Sep 11 2006 — edited Sep 11 2006
I am trying to log output to a logfile using log4j.
I successfully create a log file, but it is always empty (no messages appear in it)

My java class looks like this:

PropertyConfigurator.configure("c:/ppims/logs/clientLogs/ppimsLogging.properties");
LOG = LogFactory.getLog(LocateEOIComponentStep.class);
LOG.debug("some message");

my log4j properties file looks like this:

log4j.threshold=BUG
log4j.rootLogger=DebugAppender, InfoAppender, WarnAppender, ErrorAppender

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %p %m%n

log4j.appender.DebugAppender=org.apache.log4j.RollingFileAppender
log4j.appender.DebugAppender.File=C:\\ppims\\logs\\clientLogs\\ppimsLogging.log
log4j.appender.DebugAppender.MaxFileSize=100KB
log4j.appender.DebugAppender.MaxBackupIndex=1
log4j.appender.DebugAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.DebugAppender.layout.ConversionPattern=%d{ISO8601} %p %m%n
log4j.appender.DebugAppender.Threshold=BUG

etc

I can't understand it. My properties file has been found, since there is a new created log file after I run the code. It's just my messages are not being passed to it.
What am I doing wrong?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 9 2006
Added on Sep 11 2006
2 comments
2,687 views