log4j.properties常用配置信息

### set log levels ###
log4j.rootLogger = DEBUG , consoleApp ,  fileInfoApp, fileErrorApp

### console ###
log4j.appender.consoleApp = org.apache.log4j.ConsoleAppender
log4j.appender.consoleApp.Target = System.out
log4j.appender.consoleApp.layout = org.apache.log4j.PatternLayout
log4j.appender.consoleApp.layout.ConversionPattern = [ava.os][%p] [%-d{yyyy-MM-dd HH\:mm\:ss}] %C.%M(%L) | %m%n

### log file ###
log4j.appender.fileInfoApp = org.apache.log4j.DailyRollingFileAppender
log4j.appender.fileInfoApp.File = /logs/avaos_info.log
log4j.appender.fileInfoApp.Append = true
log4j.appender.fileInfoApp.Threshold = INFO 
log4j.appender.fileInfoApp.layout = org.apache.log4j.PatternLayout
log4j.appender.fileInfoApp.layout.ConversionPattern = [ava.os][%p] [%-d{yyyy-MM-dd HH\:mm\:ss}] %C.%M(%L) | %m%n

### exception ###
log4j.appender.fileErrorApp = org.apache.log4j.DailyRollingFileAppender
log4j.appender.fileErrorApp.File = /logs/avaos_err.log 
log4j.appender.fileErrorApp.Append = true
log4j.appender.fileErrorApp.Threshold = ERROR 
log4j.appender.fileErrorApp.layout = org.apache.log4j.PatternLayout
log4j.appender.fileErrorApp.layout.ConversionPattern = [ava.os][%p] [%-d{yyyy-MM-dd HH\:mm\:ss}] %C.%M(%L) | %m%n
发布了47 篇原创文章 · 获赞 1 · 访问量 1012
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 创作都市 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览