DailyRollingFileAppender was removed in Log4j 2x. What should be used instead?
Advertisement
Answer
Use a RollingFile
1 with TimeBasedTriggeringPolicy
2. e.g.:
<RollingFile name="RollingFile" fileName="/tmp/app.log" filePattern="/tmp/app%d{yyyy-MM-dd}.log"> <PatternLayout pattern="%d %p %c{1.} [%t] %m%n" /> <TimeBasedTriggeringPolicy /> </RollingFile>
See more in Apache Log4j 2 User’s Guide [PDF].
Notes