log4j 配置

来源:互联网 发布:哈利波特 电影 知乎 编辑:程序博客网 时间:2024/06/01 08:51

## log ........................................................

 

# This is the configuring for logging displayed in the Application Server
log4j.rootCategory=info, stdout,logfile
# log4j.rootCategory=ERROR, A1,logfile
 
#stdout configure
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern= %d %p [%c] - <%m>%n

#logfile configure
#log4j.appender.logfile=org.apache.log4j.DailyRollingFileAppender
log4j.appender.logfile=org.apache.log4j.RollingFileAppender
log4j.appender.logfile.File=${catalina.home}/logs/admin.log
log4j.appender.logfile.MaxFileSize=1MB  
log4j.appender.logfile.MaxBackupIndex=10 
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern= %d %p [%c] - <%m>%n

# Control logging for other open source packages
# Changing the log level to DEBUG when debug
log4j.logger.org.springframework=ERROR
log4j.logger.org.springframework.beans=ERROR
log4j.logger.org.springframework.aop=ERROR
log4j.logger.org.hibernate=ERROR
log4j.logger.org.hibernate.cfg.HbmBinder=ERROR
log4j.logger.org.hibernate.SQL=INFO
log4j.logger.org.hibernate.cache=ERROR
log4j.logger.org.hibernate.transaction=ERROR
log4j.logger.net.sf.ehcache=ERROR
log4j.logger.org.apache.commons=ERROR
log4j.logger.org.apache.struts2=ERROR
log4j.logger.org.directwebremoting=ERROR
log4j.logger.com.opensymphony.xwork2=ERROR
log4j.logger.freemarker=ERROR
#log4j.logger.org.codehaus.xfire=ERROR
#log4j.logger.com.lianpu.logic.dao=ERROR
#log4j.logger.com.lianpu.logic.manager=ERROR

### set log levels - for more verbose logging change 'info' to 'debug' ##
log4j.logger.org.springframework.orm.hibernate.HibernateTransactionManager = info

log4j.logger.com.hzzk.baseinfo.helper.OnlineUserLib info

log4j.rootLogger=info,stdout,logfile

log4j.logger.net.sf.hibernate=info

log4j.logger.com.hzzk.common=info,stdout

log4j.logger.com.hzzk.www.common=info,stdout
#log4j.rootCategory=info, stdout,logfile
### direct log messages to stdout ###
 

### enable the following line if you want to track down connection ###
### leakages when using DriverManagerConnectionProvider ###
#log4j.logger.net.sf.hibernate.connection.DriverManagerConnectionProvider=trace

### log JDBC bind parameters ###
#log4j.logger.net.sf.hibernate.type=info

### log prepared statement cache activity ###
#log4j.logger.net.sf.hibernate.ps.PreparedStatementCache=info
# This is the configuring for logging displayed in the Application Server
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

#
# Log4J Settings for log4j 1.2.x (via jakarta-commons-logging)
#
# The five logging levels used by Log are (in order):
#
#   1. DEBUG (the least serious)
#   2. INFO
#   3. WARN
#   4. ERROR
#   5. FATAL (the most serious)


# Set root logger level to WARN and append to stdout
log4j.rootLogger=WARN, stdout, fileout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%d %5p (%c:%L) - %m%n
log4j.appender.fileout=org.apache.log4j.RollingFileAppender
### /u8bbe/u7f6e/u8f93/u51fa/u5730fileout/u5230/u6587/u4ef6/uff08/u6587/u4ef6/u5927/u5c0f/u5230/u8fbe/u6307/u5b9a/u5c3a/u5bf8/u7684/u65f6/u5019/u4ea7/u751f/u4e00/u4e2a/u65b0/u7684/u6587/u4ef6/uff09##
log4j.appender.fileout.File=c/://tmp//ecn.html
### /u6587/u4ef6/u4f4d/u7f6e##
log4j.appender.fileout.MaxFileSize=5000KB
### /u6587/u4ef6/u5927/u5c0f##
log4j.appender.fileout.MaxBackupIndex=10
log4j.appender.fileout.layout=org.apache.log4j.HTMLLayout
# Print only messages of level ERROR or above in the package noModule.
log4j.logger.noModule=FATAL
# OpenSymphony Stuff
log4j.logger.com.opensymphony=INFO
log4j.logger.org.apache.struts2=WARN

# Spring Stuff
log4j.logger.org.springframework=WARN

#AspectJ Stuff
log4j.logger.org.aspectj=WARN

log4j.logger.com.ibatis=WARN
log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=debug
log4j.logger.com.ibatis.common.jdbc.ScriptRunner=debug
log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=debug
log4j.logger.java.sql.Connection=debug
log4j.logger.java.sql.Statement=debug
log4j.logger.java.sql.PreparedStatement=debug,stdout

log4j.logger.com.freshpower.epp=fileout

#oscache Stuff
#log4j.rootLogger=DEBUG,stdout,file

#log4j.appender.stdout=org.apache.log4j.ConsoleAppender
#log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
#log4j.appender.stdout.layout.ConversionPattern=[start]%d{yyyy/MM/dd/HH:mm:ss}[DATE]%n%p[PRIORITY]%n%x[NDC]%n%t[THREAD]n%c[CATEGORY]%n%m[MESSAGE]%n%n

log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=${catalina.home}/logs/tomcat.log
log4j.appender.file.MaxFileSize=100KB
log4j.appender.file.MaxBackupIndex=5
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=[start]%d{yyyy/MM/dd/HH:mm:ss}[DATE]%n%p[PRIORITY]%n%x[NDC]%n%t[THREAD]n%c[CATEGORY]%n%m[MESSAGE]%n%n

log4j.logger.org.apache.commons=ERROR
#log4j.logger.com.opensymphony.oscache.base=INFO

 

 

#####################################################################

#
# log4j.properties created on 05 14, 2010 18:53:34
# Copyright (c) 2010 by /u6d59/u6c5f/u65b0/u80fd/u91cf/u79d1/u6280/u6709/u9650/u516c/u53f8.
#

#
# Log4J Settings for log4j 1.2.x (via jakarta-commons-logging)
#
# The five logging levels used by Log are (in order):
#
#   1. DEBUG (the least serious)
#   2. INFO
#   3. WARN
#   4. ERROR
#   5. FATAL (the most serious)


# Set root logger level to WARN and append to stdout
log4j.rootLogger=DEBUG, stdout,file


log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %5p (%c:%L) - %m%n

log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=d:/log/log4j.log
log4j.appender.file.MaxFileSize=10240KB
log4j.appender.file.MaxBackupIndex=1
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d %5p [%t] (%F:%L) - %m%n

# oscache logger
log4j.logger.com.opensymphony.oscache.base=INFO


# OpenSymphony Stuff
log4j.logger.com.opensymphony=ERROR
log4j.logger.org.apache.struts2=ERROR

# Spring Stuff
log4j.logger.org.springframework=INFO

#AspectJ Stuff
log4j.logger.org.aspectj=ERROR


#Ibatis Stuff
log4j.logger.com.ibatis=debug
log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=debug
log4j.logger.com.ibatis.common.jdbc.ScriptRunner=debug
log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=debug
log4j.logger.java.sql.Connection=debug
log4j.logger.java.sql.Statement=debug
log4j.logger.java.sql.PreparedStatement=debug,stdout

# hibernate Stuff
log4j.logger.org.hibernate=WARN
log4j.logger.org.hibernate.hql.ast.AST=WARN
log4j.logger.org.hibernate.SQL=WARN
log4j.logger.org.hibernate.type=WARN
log4j.logger.org.hibernate.tool.hbm2ddl=WARN
log4j.logger.org.hibernate.hql=WARN
log4j.logger.org.hibernate.cache=WARN
log4j.logger.org.hibernate.transaction=WARN
log4j.logger.org.hibernate.jdbc=WARN

 

原创粉丝点击