首页 > 代码库 > log4j.properties配置文件

log4j.properties配置文件

#log4j.rootLogger=INFO,C
log4j.rootLogger=INFO,C
#first way log All
##########
# C,System.out
#log4j.appender.C.Threshold=INFO print info or above
##########
# log4j.logger.sfk.bbs=INFO,C,F
# only log the package start with sfk.bbs
#second way set log package 
log4j.appender.C=org.apache.log4j.ConsoleAppender
log4j.appender.C.Threshold=INFO 
log4j.appender.C.layout=org.apache.log4j.PatternLayout
log4j.appender.C.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %L %p %C{1} - %m%n

###########
#save in file
#log4j.appender.F.Threshold=INFO ,info or above
###########
log4j.appender.F=org.apache.log4j.DailyRollingFileAppender
# save file path
log4j.appender.F.File=D:\test\lobs.log
log4j.appender.F.Append=true
log4j.appender.F.Threshold=INFO
log4j.appender.F.layout=org.apache.log4j.PatternLayout
log4j.appender.F.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %L %p %C{1} - %m%n




 

 

log4j.properties配置文件