snippetjournal

– notes, snippet codes, and my journal

Log4j Sample Configuration

leave a comment »

# konfigurasi untuk menulis log ke fie
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=${webapp.root.path}/WEB-INF/logs/TemplateAPP.log
log4j.appender.fileout.datePattern='.'dd-MM-yyyy
log4j.appender.file.MaxFileSize=1MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ISO8601} [%t] %5p %c{1}:%L - %m%n
 
# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} [%t] %5p %c{1}:%L - %m%n
 
# Root logger option
log4j.rootLogger=INFO, file, stdout
 
# Log everything. Good for troubleshooting
log4j.logger.org.hibernate=Error
 
# Log all JDBC parameters
log4j.logger.org.hibernate.type=Error

# Log for Spring 
log4j.logger.org.springframework=Error
log4j.logger.org.springframework.security=Warn

Written by snippetjournal

September 11, 2013 at 7:52 am

Posted in Programming

Tagged with ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: