Created
August 29, 2013 19:02
-
-
Save xkr47/6382088 to your computer and use it in GitHub Desktop.
log4j configuration with different colors for different log levels - also works with Eclipse Ansi Console: http://mihai-nita.net/2013/06/03/eclipse-plugin-ansi-in-console/
This file contains 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
log4j.debug=false | |
# Default level is INFO | |
log4j.rootLogger=INFO,StdoutErrorFatal,StdoutWarn,StdoutInfo,StdoutDebug,StdoutTrace | |
# and for com.some.package.* log everything | |
log4j.logger.com.some.package=TRACE | |
log4j.appender.StdoutErrorFatal=org.apache.log4j.ConsoleAppender | |
log4j.appender.StdoutErrorFatal.layout=org.apache.log4j.PatternLayout | |
log4j.appender.StdoutErrorFatal.layout.conversionPattern=\u001b[31;1m%d{HH:mm:ss,SSS} %-5p - %-26c - [user:%X{username}] %m\n | |
log4j.appender.StdoutErrorFatal.threshold=ERROR | |
log4j.appender.StdoutWarn=org.apache.log4j.ConsoleAppender | |
log4j.appender.StdoutWarn.layout=org.apache.log4j.PatternLayout | |
log4j.appender.StdoutWarn.layout.conversionPattern=\u001b[33;1m%d{HH:mm:ss,SSS} %-5p - %-26c - [user:%X{username}] %m\n | |
log4j.appender.StdoutWarn.threshold=WARN | |
log4j.appender.StdoutWarn.filter.filter1=org.apache.log4j.varia.LevelRangeFilter | |
log4j.appender.StdoutWarn.filter.filter1.levelMin=WARN | |
log4j.appender.StdoutWarn.filter.filter1.levelMax=WARN | |
log4j.appender.StdoutInfo=org.apache.log4j.ConsoleAppender | |
log4j.appender.StdoutInfo.layout=org.apache.log4j.PatternLayout | |
log4j.appender.StdoutInfo.layout.conversionPattern=\u001b[0m%d{HH:mm:ss,SSS} %-5p - %-26c - [user:%X{username}] %m\n | |
log4j.appender.StdoutInfo.threshold=INFO | |
log4j.appender.StdoutInfo.filter.filter1=org.apache.log4j.varia.LevelRangeFilter | |
log4j.appender.StdoutInfo.filter.filter1.levelMin=INFO | |
log4j.appender.StdoutInfo.filter.filter1.levelMax=INFO | |
log4j.appender.StdoutDebug=org.apache.log4j.ConsoleAppender | |
log4j.appender.StdoutDebug.layout=org.apache.log4j.PatternLayout | |
log4j.appender.StdoutDebug.layout.conversionPattern=\u001b[0;36m%d{HH:mm:ss,SSS} %-5p - %-26c - [user:%X{username}] %m\n | |
log4j.appender.StdoutDebug.threshold=DEBUG | |
log4j.appender.StdoutDebug.filter.filter1=org.apache.log4j.varia.LevelRangeFilter | |
log4j.appender.StdoutDebug.filter.filter1.levelMin=DEBUG | |
log4j.appender.StdoutDebug.filter.filter1.levelMax=DEBUG | |
log4j.appender.StdoutTrace=org.apache.log4j.ConsoleAppender | |
log4j.appender.StdoutTrace.layout=org.apache.log4j.PatternLayout | |
log4j.appender.StdoutTrace.layout.conversionPattern=\u001b[0;30;1m%d{HH:mm:ss,SSS} %-5p - %-26c - [user:%X{username}] %m\n | |
log4j.appender.StdoutTrace.threshold=TRACE | |
log4j.appender.StdoutTrace.filter.filter1=org.apache.log4j.varia.LevelRangeFilter | |
log4j.appender.StdoutTrace.filter.filter1.levelMin=TRACE | |
log4j.appender.StdoutTrace.filter.filter1.levelMax=TRACE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment