Tuesday, July 29, 2014

LOG4J

# Root logger option
log4j.rootLogger=INFO,stdout,file

# 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{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L -  %m%n`
#log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
#log4j.appender.stdout.layout.ConversionPattern=%p %t %c - %m%n

# Daily rolling file appender for PROJECT
log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
log4j.appender.file.File=logs/logs.log
log4j.appender.file.DatePattern='.'dd-MM-yyyy
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{dd-MM-yyyy HH:mm:ss} %-5p %c{1}:%L - %m%n
#log4j.appender.file.layout.ConversionPattern=%p %t %c - %m%n

log4j.logger.jdbc.sqlonly=OFF
log4j.logger.jdbc.sqltiming=INFO,sql,stdout
log4j.logger.jdbc.audit=OFF
log4j.logger.jdbc.resultset=OFF
log4j.logger.jdbc.connection=OFF
log4j.logger.jdbc.resultsettable=INFO,sql,stdout

log4j.additivity.jdbc.sqlonly=false
log4j.additivity.jdbc.sqltiming=false
log4j.additivity.jdbc.audidt=false
log4j.additivity.jdbc.resultset=false
log4j.additivity.jdbc.connection=false
log4j.additivity.jdbc.resultsettable=false

## Daily rolling file appender for SQL Log
#the appender used for the JDBC API layer call logging above, sql only
log4j.appender.sql=org.apache.log4j.DailyRollingFileAppender
log4j.appender.sql.File=logs/sql.log
llog4j.appender.sql.DatePattern='.'dd-MM-yyyy
log4j.appender.sql.layout=org.apache.log4j.PatternLayout
log4j.appender.sql.layout.ConversionPattern=%-5p [%d{DATE} %c]: %m%n
log4j.additivity.sql=false
log4j.appender.sql.Append=false

## Spring JDBC logging
#log4j.logger.org.springframework.jdbc=DEBUG
#log4j.logger.org.springframework.jdbc.core.JdbcTemplate=DEBUG, file
##log4j.logger.org.springframework.jdbc.core.StatementCreatorUtils=TRACE, file

## Spring Transaction logging
#log4j.logger.org.springframework.transaction=INFO
#log4j.logger.org.springframework.transaction.interceptor=TRACE
##log4j.logger.org.springframework.jdbc.datasource.DataSourceTransactionManager=DEBUG
##log4j.logger.org.springframework.orm.jpa=INFO

## Hibernate Transaction logging
#log4j.logger.org.hibernate.SQL=DEBUG
#log4j.logger.org.hibernate.engine.transaction=DEBUG
#log4j.logger.org.springframework.orm.hibernate3.HibernateTransactionManager=DEBUG

# BoneCP Connection Pooling logging
#log4j.category.com.jolbox=DEBUG,stdout

No comments:

Post a Comment