DailyRollingFileAppender not working as expected

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

DailyRollingFileAppender not working as expected

This post has NOT been accepted by the mailing list yet.

I've the following property-file:

log4j.rootLogger = INFO,CONSOLE,FILE

log4j.appender.CONSOLE = org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Target = System.out
log4j.appender.CONSOLE.layout = org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern = [%d{dd MMM yyyy HH:mm:ss,SSS}] %5p %c{1} - %m%n
log4j.appender.CONSOLE.Threshold = DEBUG
log4j.appender.CONSOLE.encoding = utf-8

log4j.appender.FILE = org.apache.log4j.DailyRollingFileAppender
log4j.appender.FILE.layout = org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern        = [%d{dd MMM yyyy HH:mm:ss,SSS}] %5p %c{1} - %m%n
log4j.appender.FILE.Threshold = DEBUG
log4j.appender.FILE.File = /tmp/logs/MyLog.log
log4j.appender.FILE.DatePattern = yyyy-MM-dd
log4j.appender.FILE.Append = true
log4j.appender.FILE.encoding = utf-8

When I start my application the only log that will be created is "MyLog.log" in /tmp/logs and not as expected "MyLog.log.yyyy-MM-dd".
How is it possible to create the logfile properly?

Thanks in advance