It's a little bit frustrating to configure Tomcat 8.5.8 with log4j2.
I put the following jars in $CATALINA_HOME/lib
        log4j 2 core (log4j-core-2.6.2.jar)
        log4j 2 api (log4j-api-2.6.2.jar)
Delete the file $CATALINA_HOME/conf/logging.properties
    Put the new log4j 2 config file (log4j2.xml) in $CATALINA_HOME/lib
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="warn" name="catalina" packages="">
    <Appenders>
         <Console name="console" target="SYSTEM_OUT">
    <PatternLayout pattern="%m%n"/>
        </Console>
            <File name="catalina" fileName="${catalina.base}/logs/catalina.log">
              <PatternLayout>
                <Pattern>%d %p %c{1.} [%t] %m%n</Pattern>
              </PatternLayout>
    </File>
        <Async name="Async">
              <AppenderRef ref="catalina"/>
       </Async>
    </Appenders>
      <Loggers>
        <Root level="trace">
          <AppenderRef ref="Async"/>
         <AppenderRef ref="console"/>
        </Root>
  </Loggers>
</Configuration>
No errors but the created catalina.out file is empty and the console layout 
doesn't change
What else to check or change?
THX Frank

Reply via email to