title: Configuring log4j2 and log4j using a single log4j2 xml file
body: <p>I've migrated my application to log4j 2, and I've configured it via log4j2.xml</p>
  
  <p>However, some of the libraries I'm using depend on log4j 1. If I run the application using: </p>
  
  <pre><code>-Dlog4j.configurationFile=path/to/log4j2.xml
  </code></pre>
  
  <p>log4j 1 complains about not finding a configuration file. I'm using the log4j 1.x bridge provided by log4j 2, log4j-1.2-api-2.0-rc1.jar. Is it possible to configure both using a single log4j2.xml?</p>
  
  <p>An alternative I've tried is configuring both log4j and log4j2 together: </p>
  
  <pre><code>-Dlog4j.configurationFile=path/to/log4j2.xml -Dlog4j.configuration=path/to/log4j.xml
  </code></pre>
  
  <p>My concern is fragmentation of my logging configuration files and output. I'm also concerned about possible conflicts between log4j.xml and log4j2.xml. e.g. the logfile error.log is configured to use a FileAppender in log4j 1 and a RollingFileAppender in log4j 2.</p>
  
  <p>Any advice?</p>
  
  <p>[note]</p>
  
  <p>This is the error I'm seeing:</p>
  
  <pre><code>log4j:WARN No appenders could be found for logger (org.apache.activemq.util.ThreadPoolUtils).
  log4j:WARN Please initialize the log4j system properly.
  log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
  </code></pre>
  
  <p>The version of log4j 2 I'm using is log4j 2.0 rc1.</p>
  
  <p>[answer]</p>
  
  <p>Seems like activemq-5.8.0.jar was bundled with log4j 1. The solution was simply to load the log4j 1.x bridge before activemq.</p>