title: Tomcat not picking up Log4j config for its internal logging
body: <p>I am trying to reconfigure Tomcat 7 to use log4j for its internal logging.</p>
  
  <p>I have followed all steps in Tomcat 7 docs: <a href="http://tomcat.apache.org/tomcat-7.0-doc/logging.html" rel="nofollow noreferrer">http://tomcat.apache.org/tomcat-7.0-doc/logging.html</a> 
  It is still not using Log4J or atleast it is not using the config specified in the log4j.properties file.</p>
  
  <p>What I have tried so far:</p>
  
  <ul>
  <li><p>Copied the necessary jar files to the locations mentioned in Tomcat
  Docs</p></li>
  <li><p><code>CATALINA_HOME</code>, <code>CATALINA_BASE</code> environment variables were not
  present. Added them and set both to <code>C:\Program Files\Apache Software
  Foundation\Tomcat 7.0</code></p></li>
  <li><p>Noticed that log4J properties file had references to 
  <code>catalina.base</code> instead of catalina_base so created , catalina.base
  and <code>catalina.home</code> environment variables and set both to <code>C:\Program Files\Apache Software Foundation\Tomcat 7.0</code></p></li>
  <li><p>As suggested <a href="https://stackoverflow.com/a/20476251/681671">in another answer</a> I have deleted the "auto" entries in the Monitor Tomcat App.
  <img src="https://i.stack.imgur.com/9mlBo.jpg" alt="enter image description here"></p></li>
  </ul>
  
  <p>lib/log4j.properties</p>
  
  <pre><code>log4j.rootLogger = INFO, CATALINA
  
  # Define all the appenders
  log4j.appender.CATALINA = org.apache.log4j.DailyRollingFileAppender
  log4j.appender.CATALINA.File = ${catalina.base}/logs/catalina
  log4j.appender.CATALINA.Append = true
  log4j.appender.CATALINA.Encoding = UTF-8
  # Roll-over the log once per day
  log4j.appender.CATALINA.DatePattern = '.'yyyy-MM-dd'.log'
  log4j.appender.CATALINA.layout = org.apache.log4j.PatternLayout
  log4j.appender.CATALINA.layout.ConversionPattern = %d [%t] %-5p %c- %m%n
  
  log4j.appender.LOCALHOST = org.apache.log4j.DailyRollingFileAppender
  log4j.appender.LOCALHOST.File = ${catalina.base}/logs/localhost
  log4j.appender.LOCALHOST.Append = true
  log4j.appender.LOCALHOST.Encoding = UTF-8
  log4j.appender.LOCALHOST.DatePattern = '.'yyyy-MM-dd'.log'
  log4j.appender.LOCALHOST.layout = org.apache.log4j.PatternLayout
  log4j.appender.LOCALHOST.layout.ConversionPattern = %d [%t] %-5p %c- %m%n
  
  log4j.appender.MANAGER = org.apache.log4j.DailyRollingFileAppender
  log4j.appender.MANAGER.File = ${catalina.base}/logs/manager
  log4j.appender.MANAGER.Append = true
  log4j.appender.MANAGER.Encoding = UTF-8
  log4j.appender.MANAGER.DatePattern = '.'yyyy-MM-dd'.log'
  log4j.appender.MANAGER.layout = org.apache.log4j.PatternLayout
  log4j.appender.MANAGER.layout.ConversionPattern = %d [%t] %-5p %c- %m%n
  
  log4j.appender.HOST-MANAGER = org.apache.log4j.DailyRollingFileAppender
  log4j.appender.HOST-MANAGER.File = ${catalina.base}/logs/host-manager
  log4j.appender.HOST-MANAGER.Append = true
  log4j.appender.HOST-MANAGER.Encoding = UTF-8
  log4j.appender.HOST-MANAGER.DatePattern = '.'yyyy-MM-dd'.log'
  log4j.appender.HOST-MANAGER.layout = org.apache.log4j.PatternLayout
  log4j.appender.HOST-MANAGER.layout.ConversionPattern = %d [%t] %-5p %c- %m%n
  
  log4j.appender.CONSOLE = org.apache.log4j.ConsoleAppender
  log4j.appender.CONSOLE.Encoding = UTF-8
  log4j.appender.CONSOLE.layout = org.apache.log4j.PatternLayout
  log4j.appender.CONSOLE.layout.ConversionPattern = %d [%t] %-5p %c- %m%n
  
  # 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>