java - Using FileNamePattern, RollingFileAppender in log4j -
i have log file named app.log. when rolls on (i'm setting every minute testing purposes), renamed app-yyyy-mm-dd_hh-mm.log
it's not working. below log4j settings:
log4j.appender.mylog=org.apache.log4j.rollingfileappender log4j.appender.mylog.rollingpolicy=timebasedrollingpolicy log4j.appender.mylog.file=logs/app.log log4j.appender.mylog.rollingpolicy.filenamepattern=logs/app-%d{yyyy-mm-dd_hh-mm}.log log4j.appender.mylog.append=true log4j.appender.mylog.layout=org.apache.log4j.patternlayout log4j.appender.mylog.layout.conversionpattern=%d %-5p [%t] %-17c{2} (%13f:%l) %3x - %m%n
does know what's problem? during rollover, renames file app.log.1
.
according log4j wiki:
note timebasedrollingpolicy can configured xml, not log4j.properties
the api doesn't mention that, perhaps that's problem?
Comments
Post a Comment