Log4j的配置文件

# This is the configuring for logging displayed in the Application Server
log4j.rootCategory=debug, stdout,common-default,common-warn,common-error
log4j.logger.org.apache.shiro=TRACE
# debug log for mybatis
log4j.logger.java.sql.Connection=DEBUG,common-dao
log4j.logger.java.sql.Statement=INFO,common-dao
log4j.logger.java.sql.PreparedStatement=INFO,common-dao
log4j.logger.java.sql.ResultSet=INFO,common-dao
################################
# common appenders
################################
#stdout configure
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.conversionPattern= %d [ %-5p %c - %m ] -- [%X{loginUserId}/%X{req.remoteAddr}/%X{traceId} - %X{entranceMethod} - %X{req.requestURIWithQueryString}] %n

#common-default file appender
log4j.appender.common-default=org.apache.log4j.DailyRollingFileAppender
log4j.appender.common-default.file=${user.home}/logs/common-default.log
log4j.appender.common-default.layout=org.apache.log4j.PatternLayout
log4j.appender.common-default.layout.conversionPattern= %d [%X{loginUserId}/%X{req.remoteAddr}/%X{traceId} - %X{entranceMethod} - %X{req.requestURIWithQueryString}] %-5p %c - %m%n

#common-warn file appender
log4j.appender.common-warn=org.apache.log4j.DailyRollingFileAppender
log4j.appender.common-warn.file=${user.home}/logs/common-warn.log
log4j.appender.common-warn.layout=org.apache.log4j.PatternLayout
log4j.appender.common-warn.filter.ID=org.apache.log4j.varia.LevelRangeFilter
log4j.appender.common-warn.filter.ID.levelMin=WARN
log4j.appender.common-warn.filter.ID.levelMax=WARN
log4j.appender.common-warn.layout.conversionPattern= %d [%X{loginUserId}/%X{req.remoteAddr}/%X{traceId} - %X{entranceMethod} - %X{req.requestURIWithQueryString}] %-5p %c - %m%n

#common-error file appender
log4j.appender.common-error=org.apache.log4j.DailyRollingFileAppender
log4j.appender.common-error.file=${user.home}/logs/common-error.log
log4j.appender.common-error.layout=org.apache.log4j.PatternLayout
log4j.appender.common-error.threshold=ERROR
log4j.appender.common-error.layout.conversionPattern= %d [%X{loginUserId}/%X{req.remoteAddr}/%X{traceId} - %X{entranceMethod} - %X{req.requestURIWithQueryString}] %-5p %c - %m%n

#common-dao file appender
log4j.appender.common-dao=org.apache.log4j.DailyRollingFileAppender
log4j.appender.common-dao.file=${user.home}/logs/common-dao.log
log4j.appender.common-dao.layout=org.apache.log4j.PatternLayout
log4j.appender.common-dao.layout.conversionPattern= %d [%X{loginUserId}/%X{req.remoteAddr}/%X{traceId} - %X{entranceMethod} - %X{req.requestURIWithQueryString}] %-5p %c - %m%n

#common-web file appender
log4j.appender.common-web=org.apache.log4j.DailyRollingFileAppender
log4j.appender.common-web.file=${user.home}/logs/common-web.log
log4j.appender.common-web.layout=org.apache.log4j.PatternLayout
log4j.appender.common-web.layout.conversionPattern= %d [%X{loginUserId}/%X{req.remoteAddr}/%X{traceId} - %X{entranceMethod} - %X{req.requestURIWithQueryString}] %-5p %c - %m%n

#common-pageNotFound file appender
log4j.appender.common-pageNotFound=org.apache.log4j.DailyRollingFileAppender
log4j.appender.common-pageNotFound.file=${user.home}/logs/common-pageNotFound.log
log4j.appender.common-pageNotFound.layout=org.apache.log4j.PatternLayout
log4j.appender.common-pageNotFound.layout.conversionPattern= %d [%X{loginUserId}/%X{req.remoteAddr}/%X{traceId} - %X{entranceMethod} - %X{req.requestURIWithQueryString}] %-5p %c - %m%n

################################
# project appenders
################################
#project-dao file appender
log4j.appender.project-dao=org.apache.log4j.DailyRollingFileAppender
log4j.appender.project-dao.file=${user.home}/logs/project-dao.log
log4j.appender.project-dao.layout=org.apache.log4j.PatternLayout
log4j.appender.project-dao.threshold=INFO
log4j.appender.project-dao.layout.conversionPattern= %d [%X{loginUserId}/%X{req.remoteAddr}/%X{traceId} - %X{entranceMethod} - %X{req.requestURIWithQueryString}] %-5p %c - %m%n

#project-web file appender
log4j.appender.project-web=org.apache.log4j.DailyRollingFileAppender
log4j.appender.project-web.file=${user.home}/logs/project-web.log
log4j.appender.project-web.layout=org.apache.log4j.PatternLayout
log4j.appender.project-web.threshold=INFO
log4j.appender.project-web.layout.conversionPattern= %d [%X{loginUserId}/%X{req.remoteAddr}/%X{traceId} - %X{entranceMethod} - %X{req.requestURIWithQueryString}] %-5p %c - %m%n

#project-service file appender
log4j.appender.project-service=org.apache.log4j.DailyRollingFileAppender
log4j.appender.project-service.file=${user.home}/logs/project-service.log
log4j.appender.project-service.layout=org.apache.log4j.PatternLayout
log4j.appender.project-service.threshold=INFO
log4j.appender.project-service.layout.conversionPattern= %d [%X{loginUserId}/%X{req.remoteAddr}/%X{traceId} - %X{entranceMethod} - %X{req.requestURIWithQueryString}] %-5p %c - %m%n

################################
# open source framework loggers
################################
#spring
log4j.logger.org.springframework=debug
log4j.logger.org.springframework.jdbc.core.JdbcTemplate=DEBUG,common-dao


# hibernate: Changing the log level to DEBUG will display SQL Hibernate generated
log4j.logger.org.hibernate=INFO,common-dao
log4j.logger.org.hibernate.SQL=ERROR
log4j.logger.net.sf.ehcache=ERROR

#springmvc pageNotFound
log4j.logger.org.springframework.web.servlet.PageNotFound=INFO,common-pageNotFound

#HibernateValidator
log4j.logger.org.apache.commons.validator.ValidatorResources=INFO

log4jdbc, see: http://code.google.com/p/rapid-framework/wiki/log4jdbc  for details
log4j.logger.jdbc.sqlonly=ON,stdout
log4j.logger.jdbc.sqltiming=debug,common-dao
log4j.logger.org.hibernate.cache=ERROR
log4j.logger.jdbc.audit=OFF
log4j.logger.jdbc.resultset=debug,stdout
log4j.logger.jdbc.connection=ON,stdout
log4j.logger.org.apache.ibatis=debug,stdout
log4j.logger.java.sql=debug,stdout
################################
# project loggers
################################
log4j.logger.org.apache.commons.beanutils=INFO,project-dao
log4j.logger.com.xs.calltaxi.dao=INFO,project-dao
log4j.logger.com.xs.calltaxi.service=INFO,project-service
log4j.logger.com.xs.calltaxi.web=INFO,project-web

你可能感兴趣的:(Log4j的配置文件)