具體配置內容以下 html
- # 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中,次日後,服務器會自動把前一天的日誌放到web
logfile_log_2012-12-05.hmtl中,格式很是的漂亮,具體我就不傳圖了,有啥不明白的請留言sql