又是我們需要開啟debug來排查故障,只需在項目目錄下創建檔案 WEB-INF/classes/log4j.properties 內容如下
log4j.rootLogger=debug,console,file
重新啟動tomcat將進入Debug模式,你將看到大量的調試信息。
1) log4j.properties: Add the console to the root logger log4j.rootLogger = INFO, CATALINA, CONSOLE 2) log4j.properties: Change the DailyRollingFileAppender to: log4j.appender.CATALINA=org.apache.log4j.rolling.RollingFileAppender log4j.appender.CATALINA.RollingPolicy=org.apache.log4j.rolling.TimeBasedRollingPolicy log4j.appender.CATALINA.RollingPolicy.FileNamePattern=${catalina.base}/logs/catalina.%d{yyyy-MM-dd}.log