具体配置内容如下
- # For JBoss: Avoid to setup Log4J outside $JBOSS_HOME/server/default/deploy/log4j.xml!
- # For all other servers: Comment out the Log4J listener in web.xml to activate Log4J.
- log4j.rootLogger=info,logfile
- log4j.appender.logfile=org.apache.log4j.DailyRollingFileAppender
- log4j.appender.logfile.encoding=UTF-8
- log4j.appender.logfile.File=../logs/logfile_log_
- log4j.appender.logfile.DatePattern=yyyy-MM-dd'.html'
- log4j.appender.logfile.layout=org.apache.log4j.HTMLLayout
当天的日志会输入到logfile_log中,第二天后,服务器会自动把前一天的日志放到
logfile_log_2012-12-05.hmtl中,格式非常的漂亮,具体我就不传图了,有啥不明白的请留言
转载于:https://blog.51cto.com/sucre/1080541