Created
February 20, 2013 17:47
-
-
Save eribeiro/4997455 to your computer and use it in GitHub Desktop.
Log4j properties example
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
#------------------------------------------------------------------------------ | |
# | |
# The following properties set the logging levels and log appender. The | |
# log4j.rootCategory variable defines the default log level and one or more | |
# appenders. For the console, use 'S'. For the daily rolling file, use 'R'. | |
# For an HTML formatted log, use 'H'. | |
# | |
# To override the default (rootCategory) log level, define a property of the | |
# form (see below for available values): | |
# | |
# log4j.logger. = | |
# | |
# Available logger names: | |
# TODO | |
# | |
# Possible Log Levels: | |
# FATAL, ERROR, WARN, INFO, DEBUG | |
# | |
#------------------------------------------------------------------------------ | |
log4j.rootCategory=INFO, S | |
log4j.logger.com.dappit.Dapper.parser=ERROR | |
log4j.logger.org.w3c.tidy=FATAL | |
#------------------------------------------------------------------------------ | |
# | |
# The following properties configure the console (stdout) appender. | |
# See http://logging.apache.org/log4j/docs/api/index.html for details. | |
# | |
#------------------------------------------------------------------------------ | |
log4j.appender.S = org.apache.log4j.ConsoleAppender | |
log4j.appender.S.layout = org.apache.log4j.PatternLayout | |
log4j.appender.S.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n | |
#------------------------------------------------------------------------------ | |
# | |
# The following properties configure the Daily Rolling File appender. | |
# See http://logging.apache.org/log4j/docs/api/index.html for details. | |
# | |
#------------------------------------------------------------------------------ | |
log4j.appender.R = org.apache.log4j.DailyRollingFileAppender | |
log4j.appender.R.File = logs/bensApps.log | |
log4j.appender.R.Append = true | |
log4j.appender.R.DatePattern = '.'yyy-MM-dd | |
log4j.appender.R.layout = org.apache.log4j.PatternLayout | |
log4j.appender.R.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n | |
#------------------------------------------------------------------------------ | |
# | |
# The following properties configure the Rolling File appender in HTML. | |
# See http://logging.apache.org/log4j/docs/api/index.html for details. | |
# | |
#------------------------------------------------------------------------------ | |
log4j.appender.H = org.apache.log4j.RollingFileAppender | |
log4j.appender.H.File = logs/bensApps.html | |
log4j.appender.H.MaxFileSize = 100KB | |
log4j.appender.H.Append = false | |
log4j.appender.H.layout = org.apache.log4j.HTMLLayout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment