title: Converting log4j.properties file for Tomcat to work with Log4j2
body: <p>I'm trying to configure Tomcat 8 to use Log4j2 for logging. </p>
  
  <p>I've found this reference for <a href="http://tomcat.apache.org/tomcat-8.0-doc/logging.html#Using_Log4j" rel="noreferrer">Logging in Tomcat using Log4j</a>. It provides a sample log4j.properties file that configures Log4j to match Tomcat's internal logging. Most of this looks pretty straightforward to convert for Log4j2, but the section at the end that maps loggers to appenders has me stumped: </p>
  
  <pre><code># Configure which loggers log to which appenders
  log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost] = INFO, LOCALHOST
  log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager] =\
    INFO, MANAGER
  log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager] =\
    INFO, HOST-MANAGER
  </code></pre>
  
  <p>Has anyone converted this configuration to work with Log4j2? I've been working from the Log4j2 configuration documentation and have read through the <a href="http://logging.apache.org/log4j/2.0/manual/architecture.html" rel="noreferrer">Log4j2 Architecture page</a>, but I haven't found much material on how to do this sort of container mapping in Log4j2.</p>
  
  <p>I suppose I could do a separate configuration for each container, but I'd prefer to keep it in one place, as in the sample Log4j configuration.</p>