[ 
https://issues.apache.org/jira/browse/LOG4J2-986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Olivier Grégoire updated LOG4J2-986:
------------------------------------
    Description: 
This configuration:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
    <Appenders>
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="[%level] %message%exception{short}%n"/>
        </Console>
    </Appenders>
    <Loggers>
        <Root level="trace">
            <AppenderRef ref="Console"/>
        </Root>
    </Loggers>
</Configuration>

And this use case

import org.apache.logging.log4j.LogManager;
import org.junit.Test;
public class Log4j2Test {
  @Test public void testLogging() {
    LogManager.getLogger().info("expecting [INFO]", new RuntimeException());
  }
}


Result in 

> PatternLayout doesn't print "[%level]
> -------------------------------------
>
>                 Key: LOG4J2-986
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-986
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2
>            Reporter: Olivier Grégoire
>
> This configuration:
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration>
>     <Appenders>
>         <Console name="Console" target="SYSTEM_OUT">
>             <PatternLayout pattern="[%level] %message%exception{short}%n"/>
>         </Console>
>     </Appenders>
>     <Loggers>
>         <Root level="trace">
>             <AppenderRef ref="Console"/>
>         </Root>
>     </Loggers>
> </Configuration>
> And this use case
> import org.apache.logging.log4j.LogManager;
> import org.junit.Test;
> public class Log4j2Test {
>   @Test public void testLogging() {
>     LogManager.getLogger().info("expecting [INFO]", new RuntimeException());
>   }
> }
> Result in 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to