Created
January 19, 2018 00:10
-
-
Save rocketraman/9a92ce76ee79bf6a15ab9b3a5ec95e08 to your computer and use it in GitHub Desktop.
Reproduction recipe for https://issues.apache.org/jira/browse/LOG4J2-2195
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<Configuration status="warn"> | |
<Appenders> | |
<Console name="Console" target="SYSTEM_OUT" direct="true"> | |
<PatternLayout pattern="%d{DEFAULT} - %msg - %xEx{full,filters(com.test,separator(|)}}%n"/> | |
</Console> | |
</Appenders> | |
<Loggers> | |
<Root level="debug"> | |
<AppenderRef ref="Console"/> | |
</Root> | |
</Loggers> | |
</Configuration> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2018-01-18 19:10:20,592 - This is a test. - java.lang.Exception: Test exception! | |
at TestLogging.main(TestLogging.java:8) [classes/:?] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.logging.log4j.LogManager; | |
import org.apache.logging.log4j.Logger; | |
public class TestLogging { | |
private static final Logger logger = LogManager.getLogger("HelloWorld"); | |
public static void main(String[] args) { | |
logger.info("This is a test.", new Exception("Test exception!")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment