log4j问题
当遇到:
log4j:WARNPleaseinitializethelog4jsystemproperly.
log4j:WARNNoappenderscouldbefoundforlogger(org.apache.commons.beanutils.ConvertUtils).
则在WEB-INF/classes文件夹下添加:log4j.properties
内容如下:
log4j.rootLogger=DEBUG,stdout,R log4j.logger.org=ERROR, A1 log4j.logger.com.gc.action=DEBUG,A2 log4j.appender.A1=org.apache.log4j.RollingFileAppender log4j.appender.A1.File=org.log log4j.appender.A1.MaxFileSize=500KB log4j.appender.A1.MaxBackupIndex=50 log4j.appender.A1.Append=true log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%d{ISO8601} - [%p] [%C{1}] - %m%n log4j.appender.A2=org.apache.log4j.RollingFileAppender log4j.appender.A2.File=gc.log log4j.appender.A2.MaxFileSize=500KB log4j.appender.A2.MaxBackupIndex=50 log4j.appender.A2.Append=true log4j.appender.A2.layout=org.apache.log4j.PatternLayout log4j.appender.A2.layout.ConversionPattern=%d{ISO8601} - [%p] [%C{1}] - %m%n #--------------------stdout-------------------------------- 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=[%-5p] %d{yyyy-MM-dd HH:mm:ss} %c - %m%n #--------------------R-------------------------------- #log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R=org.apache.log4j.DailyRollingFileAppender #this log file will be stored in web server's /bin directory,modify to your path which want to store. log4j.appender.R.File=gf.log #log4j.appender.R.datePattern='.'yyyy-MM-dd-HH-mm log4j.appender.R.datePattern='.'yyyy-MM-dd log4j.appender.R.append=true ## Keep one backup file log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=[%-5p] %d{yyyy-MM-dd HH:mm:ss} %c - %m%n #[%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n
相关推荐
大唐帝国前营 2020-08-18
MrLiar 2020-07-07
丨Fanny丨Cri 2020-06-13
chw0 2020-11-04
sdaq 2020-07-26
sdaq 2020-06-16
CXC0 2020-06-14
CXC0 2020-06-08
dongxurr 2020-06-07
sdaq 2020-06-06
MrLiar 2020-06-04
丨Fanny丨Cri 2020-06-03
MrLiar 2020-05-25
丨Fanny丨Cri 2020-05-17
MrLiar 2020-05-14
MrLiar 2020-05-12
sdaq 2020-05-11