Hello,

I am working on a jax-rs project that uses log4j through slf4j-api and 
log4j-slf4j-impl. So far, I configured the logging pattern via Wildfly’s 
standalone.xml. But I want to have a project wide config file for logging.

I put a log4j2.xml in the resources folder, but when I run it, it just uses the 
pattern of the standalone.xml.

Here is my log4j2.xml: 

  <?xml version="1.0" encoding="UTF-8"?>
  <Configuration status="WARN">
    <Appenders>
      <Console name="Console" target="SYSTEM_OUT">
        <PatternLayout pattern="MYLOG TEST  %d{HH:mm:ss.SSS} [%t] %-5level 
%logger{36} - %msg%n"/>
      </Console>
    </Appenders>
    <Loggers>
      <Root level="error">
        <AppenderRef ref="Console"/>
      </Root>
    </Loggers>
  </Configuration>

What am I missing? It seems that the file was not read?  In the output in my 
IntelliJ IDEA IDE I just see the log messages in the format I set in the 
standalone.xml.

Best regards,
Christian

Reply via email to