关闭开源框架的日志的debug 功能 ,以便于只显示自己开发的程序代码的DEBUG 日志

关闭开源框架的日志的debug功能,以便于只显示自己开发的程序代码的DEBUG日志,便于测试

log4j.properties文件内容如下

log4j.rootLogger=debug,console,coreLog

log4j.appender.console=org.apache.log4j.ConsoleAppender

log4j.appender.console.layout=org.apache.log4j.PatternLayout

log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-ddHH\:mm\:ss}[%m][%t][%c][%p]%n

#log4j.appender.stdout.layout.ConversionPattern=%-5p%d%c(line:%L)%x-%m%n

log4j.appender.coreLog=org.apache.log4j.DailyRollingFileAppender

log4j.appender.coreLog.File=/logs/CityMonitoringPlatform-branches-linkage.log

log4j.appender.coreLog.DatePattern='.'yyyyMMdd'.log'

log4j.appender.coreLog.layout=org.apache.log4j.PatternLayout

#log4j.appender.coreLog.layout.ConversionPattern=%d{yyyy-MM-ddHH\:mm\:ss}[%m]%n

log4j.appender.coreLog.layout.ConversionPattern=%d{yyyy-MM-ddHH\:mm\:ss}[%m][%t][%c]%n

#=================关闭StrutsHibernateIbatisSpringHttpClient等开源框架的日志的debug功能,以便于只显示自己开发的程序代码的DEBUG日志==================

log4j.logger.com.opensymphony.oscache=ERROR

log4j.logger.net.sf.navigator=ERROR

log4j.logger.net.sf.acegisecurity=WARN

log4j.logger.net.sf.acegisecurity.intercept.event.LoggerListener=WARN

log4j.logger.org.apache.commons=ERROR

log4j.logger.com.opensymphony.xwork2=ERROR

log4j.logger.org.apache.struts=WARN

log4j.logger.org.displaytag=ERROR

log4j.logger.org.springframework=WARN

log4j.category.org.springframework=WARN

log4j.logger.com.ibatis.db=WARN

log4j.logger.org.apache.velocity=WARN

#Don'tshowdebuglogsforWebTest

log4j.logger.com.canoo.webtest=WARN

#Allhibernatelogoutputof"info"levelorhighergoestostdout.

#Formoreverboselogging,changethe"info"to"debug"onthelastline.

log4j.logger.org.hibernate.ps.PreparedStatementCache=WARN

log4j.logger.org.hibernate=WARN

#ChangingthelogleveltoDEBUGwillresultinHibernategenerated

#SQLtobelogged.

log4j.logger.org.hibernate.SQL=ERROR

#ChangingthelogleveltoDEBUGwillresultinthePreparedStatement

#boundvariablevaluestobelogged.

log4j.logger.org.hibernate.type=ERROR

#关闭apachehttpClientdebug日志的方法(log4j版)

log4j.logger.httpclient.wire.header=ERROR

log4j.logger.httpclient.wire.content=ERROR

log4j.logger.org.apache.commons.httpclient=ERROR

#log4j.appender.ROLLING_FILE=org.apache.log4j.RollingFileAppender

#log4j.appender.ROLLING_FILE.Threshold=error

#log4j.appender.ROLLING_FILE.File=D:/SP-server.log

#log4j.appender.ROLLING_FILE.Append=true

#log4j.appender.ROLLING_FILE.MaxFileSize=10MB

#log4j.appender.ROLLING_FILE.MaxBackupIndex=1

#log4j.appender.ROLLING_FILE.layout=org.apache.log4j.PatternLayout

#log4j.appender.ROLLING_FILE.layout.ConversionPattern=%d-5p%c%x-%m%n

#log4j.appender.DATABASE.Threshold=info

#log4j.appender.DATABASE=org.apache.log4j.jdbc.JDBCAppender

#log4j.appender.DATABASE.URL=jdbc:mysql://localhost:3306/spserver

#log4j.appender.DATABASE.driver=com.mysql.jdbc.Driver

#log4j.appender.DATABASE.user=root

#log4j.appender.DATABASE.password=root

#log4j.appender.DATABASE.sql=INSERTINTOlog4j(priority,dtime,Message)VALUES('%p',left('%d',19),'%x%m')

#log4j.appender.DATABASE.layout=org.apache.log4j.PatternLayout

#log4j.appender.DATABASE.layout.ConversionPattern=%-5p%d%m%n

相关推荐