# 日志记录级别: # The five logging levels used by Log are (in order): # 1. DEBUG (the least serious) # 2. INFO # 3. WARN # 4. ERROR # 5. FATAL (the most serious) # this # V log4j.rootLogger=DEBUG, stdout, file
# Output to the stdout (默认配置) log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=com.momathink.common.plugin.log.ExPatternLayout log4j.appender.stdout.layout.ConversionPattern=%n%-d{yyyy-MM-dd HH:mm:ss}%n[%p]-[ConfigName:%W]-[Thread:%t]-[%C.%M()]:%n%m%n
# Output to the File (输出到文件配置, 只记录ERROR级的) log4j.appender.file=org.apache.log4j.DailyRollingFileAppender log4j.appender.file.DatePattern='_'yyyy-MM-dd'.log' log4j.appender.file.File=/www/wwwlogs/dz.log log4j.appender.file.Threshold=ERROR log4j.appender.file.layout=com.momathink.common.plugin.log.ExPatternLayout log4j.appender.file.layout.ConversionPattern=%n%-d{yyyy-MM-dd HH:mm:ss}%n[%p]-[ConfigName:%W]-[Thread:%t]-[%C.%M()]:%n%m%n
试试这个: