Tomcat确实记录了堆栈跟踪,但是当从IDE启动tomcat时,并不总是清楚日志文件在哪里。当我从IntelliJ启动它时,CATALINA_BASE
设置为${home}/.IntelliJIdea10/system/tomcat/Unnamed_r6-idea
,并且日志文件在中[CATALINA_BASE]/logs
。
要查看日志,请找到日志文件,或进行编辑[CATALINA_HOME]/conf/logging.properties
以将tomcat logger输出定向到控制台。下面,我在默认的tomcat配置中添加了第二个处理程序:
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
现在,完整的堆栈跟踪将出现在IntelliJ输出中:
Dec 27, 2011 12:02:45 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter filterChainProxy
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'filterChainProxy' is defined at
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:529)
. . .