Skip to content
Advertisement

DailyRollingFileAppender alternative in Log4j 2x

DailyRollingFileAppender was removed in Log4j 2x. What should be used instead?

Advertisement

Answer

Use a RollingFile 1 with TimeBasedTriggeringPolicy 2. e.g.:

JavaScript

See more in Apache Log4j 2 User’s Guide [PDF].


Notes

  1. org.apache.logging.log4j.core.appender.RollingFileAppender
  2. org.apache.logging.log4j.core.appender.rolling.TimeBasedTriggeringPolicy
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement