title: In log4j 1.2 to log4j 2 migration, what to do with the DailyRollingFileAppender class?
body: <p>I'm working on migrating a Java project from using log4j 1.2 for logging to using log4j 2. </p>
  
  <p>log4j 1.x has a class <a href="https://logging.apache.org/log4j/1.2/apidocs/" rel="noreferrer"><code>org.apache.log4j.DailyRollingFileAppender</code></a> which is mentioned in my project's log4j.properties configuration file. A class with the same name   <code>DailyRollingFileAppender</code> no longer exist in log4j 2.  I wonder if <code>DailyRollingFileAppender</code>'s role can be replaced by some other class(es) or some replacement configuration or implementation in log4j 2. </p>
  
  <p>The migration guide emphasizes that the application must not access methods and classes internal to log4j 1.x such as <code>Appender</code>s for it to be migratible to log4j 2.  But in order to do the migration, what can be done to <code>DailyRollingFileAppender</code>?  Is it possible to replace it by some custom  configuration, or combination of classes in log4j 2?  There are <a href="http://logging.apache.org/log4j/2.x/manual/migration.html" rel="noreferrer">some configuration examples in the migration guide</a>, in particular, one with <code>FileAppender</code>, but what about <code>DailyRollingFileAppender</code>?  It's something fairly close to the basic <code>FileAppender</code>:</p>
  
  <p>From <a href="https://logging.apache.org/log4j/1.2/apidocs/" rel="noreferrer">log4j 1.2 API Javadoc</a>, class <code>org.apache.log4j.DailyRollingFileAppender</code></p>
  
  <blockquote>
    <p>DailyRollingFileAppender extends FileAppender so that the underlying file is rolled over at a user chosen frequency. DailyRollingFileAppender has been observed to exhibit synchronization issues and data loss. The log4j extras companion includes alternatives which should be considered for new deployments and which are discussed in the documentation for org.apache.log4j.rolling.RollingFileAppender.</p>
  </blockquote>