I want daily logs with the log file appended with the date in yyyy-dd-mm format. When I use DailyRollingFileAppender, a new log file is not created. The logs are written to the same log file. Also, the date Pattern provided is not considered. The log file created is LoggerFile.log. And every content(even on the next day) is written to this file.
I am using the log4j-1.2.17 jar. I am developing in Netbeans 7.3.1 in Java.
Is there anyone using this JAR and facing such a problem. Please help!
Here is the content of the properties file I use:
# Root logger option
log4j.rootLogger=ERROR,FILE,stdout
# Define the file appender
log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender
log4j.appender.FILE.File=.//..//logs//LoggerFile.log
# Define the layout for file appender
log4j.appender.FILE.DatePattern='.'yyyy-MM-dd
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS zzz} %5p %c{1}:%L - %m%n
log4j.appender.FILE.MaxFileSize=10MB
# Direct log messages to stdout
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{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n`