I am using log4j-1.2.16.jar and apache-log4j-extras-1.2.17.jar.
I want to enable rolling files with date appended to the filename. But showing this errot and files are not rotating as expected.
My log4j.properties file looks like this.
zookeeper.root.logger=DEBUG, ROLLINGFILE
zookeeper.console.threshold=DEBUG
zookeeper.log.dir=/path/to/logs
zookeeper.log.file=zookeeper.log
zookeeper.log.threshold=DEBUG
zookeeper.tracelog.dir=.
zookeeper.tracelog.file=zookeeper_trace.log
log4j.appender.ROLLINGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.ROLLINGFILE.Threshold=${zookeeper.log.threshold}
log4j.appender.ROLLINGFILE.File=${zookeeper.log.dir}/${zookeeper.log.file}
log4j.appender.ROLLINGFILE.rollingPolicy=org.apache.log4j.rolling.TimeBasedRollingPolicy
log4j.appender.ROLLINGFILE.rollingPolicy.fileNamePattern=${zookeeper.log.dir}/app%d{yyyy-MM-dd}.log
log4j.appender.ROLLINGFILE.MaxFileSize=20KB
log4j.appender.ROLLINGFILE.MaxBackupIndex=100000
log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n
1.2.17
: https://mcmap.net/q/366773/-configuring-rollingfileappender-in-log4j And the versions of these two jar files should be aligned. – HilltopDailyRollingFileAppender
instead: https://mcmap.net/q/1988623/-log4j-warn-unrecognized-element-rollingpolicy – HilltopDailyRollingFileAppender
does not rotate files by size right? – Noun