当前位置: 首页 > 工具软件 > log4j-finder > 使用案例 >

java的log4j配置_java log4j配置

东方文林
2023-12-01

# Output pattern : date [thread] priority category - message

log4j.rootLogger= INFO , Console,RollingFileInfo,RollingFileErr

#设置每天生成一个文件名后添加的名称,备份名称:年月日.log

#log4j.appender.dailyFile.DatePattern='.'yyyy-MM-dd'.log'

#stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.Threshold=info

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,SSS} [%c]-[%p] %m%n

#Console

log4j.appender.Console=org.apache.log4j.ConsoleAppender

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

log4j.appender.Console.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n

log4j.appender.Console.Threshold=info

#RollingFile

log4j.appender.RollingFileInfo=org.apache.log4j.RollingFileAppender

log4j.appender.RollingFileInfo.file=${webapp.root}/WEB-INF/logs/hxserver.log

log4j.appender.RollingFileInfo.MaxFileSize=10MB

log4j.appender.RollingFileInfo.MaxBackupIndex=50

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

log4j.appender.RollingFileInfo.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n

log4j.appender.RollingFileInfo.Threshold=info

#errInfo

log4j.appender.RollingFileErr=org.apache.log4j.RollingFileAppender

log4j.appender.RollingFileErr.file=${webapp.root}/WEB-INF/logs/hxserverErr.log

log4j.appender.RollingFileErr.MaxFileSize=10MB

log4j.appender.RollingFileErr.MaxBackupIndex=50

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

log4j.appender.RollingFileErr.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n

log4j.appender.RollingFileErr.Threshold=error

#Inv server synchronization

log4j.logger.com.sxct.base=debug,asncInv

log4j.appender.asncInv=org.apache.log4j.RollingFileAppender

log4j.appender.asncInv.file=${webapp.root}/WEB-INF/logs/asncInv.log

log4j.appender.asncInv.MaxFileSize=10MB

log4j.appender.asncInv.MaxBackupIndex=50

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

log4j.appender.asncInv.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n

log4j.appender.asncInv.Threshold=error

#Project defalult level

log4j.logger.com.sxct.wsbs=INFO

#Forbidden struts2 ClassFinder message

log4j.logger.com.opensymphony.xwork2.util.finder.ClassFinder=OFF

 类似资料: