log4j.rootLogger=DEBUG,console,R
#控制台日志配置
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.threshold=DEBUG
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} [%5p] - %c -%F(%L) -%m%n
#文件日志配置
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.Append=true
log4j.appender.R.File=${catalina.home}/logs/babasport.log
log4j.appender.R.Threshold=INFO
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} [%5p] - %c -%F(%L) -%m%n
log4j.appender.R.MaxFileSize=10MB
#设置struts的日志级别
log4j.logger.com.opensymphony.xwork2=ERROR
log4j.logger.org.apache.struts2=ERROR
log4j.logger.org.apache.struts2.convention=ERROR
log4j.logger.com.opensymphony.xwork2.util.finder=ERROR
#设置freemarker日志
#log4j.logger.freemarker.cache=ERROR
#log4j.logger.freemarker.beans=ERROR
#设置hibernate日志
log4j.logger.org.hibernate.ps.PreparedStatementCache=WARN
log4j.logger.org.hibernate=WARN
log4j.logger.org.hibernate.SQL=DEBUG
log4j.logger.org.hibernate.type=TRACE
#设置ibatis日志
#log4j.logger.com.ibatis.io=ERROR
#log4j.logger.com.ibatis.db=WARN
#设置spring
log4j.logger.org.springframework=ERROR
#设置其他
log4j.logger.com.opensymphony.oscache=INFO
log4j.logger.net.sf.navigator=ERROR
log4j.logger.org.apache.commons=ERROR
log4j.logger.org.displaytag=ERROR
log4j.logger.org.apache.velocity=FATAL
#设置jsp日志
log4j.logger.org.apache.jasper.servlet=OFF
log4j.logger.org.apache.catalina.core=OFF
参考地址:
https://www.cnblogs.com/ll409546297/p/6841093.html