Tomcat的確實記錄的堆棧跟蹤,但它並不總是很清楚其中的日誌文件,當Tomcat從IDE開始。當我從IntelliJ啓動它時,CATALINA_BASE
設置爲${home}/.IntelliJIdea10/system/tomcat/Unnamed_r6-idea
,並且日誌文件位於[CATALINA_BASE]/logs
中。
要查看日誌,要麼找到日誌文件,或編輯[CATALINA_HOME]/conf/logging.properties
直接tomcat的記錄器輸出到控制檯。下面我添加了第二個處理器的默認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)
. . .
我使用的吉斯 - Servlet和做在我的設置方法使用try/catch這個框架我能捕獲所有異常並在記錄自己後重新推出它們。我仍然不得不盲目調試讓Guice-Servlet的過濾器工作,但添加的任何東西似乎都可以工作。 – benstpierre 2010-06-21 16:54:19
似乎堆棧跟蹤轉到標準輸出,但Intellij不讀取Tomcat的標準輸出。 http://tomcat.apache.org/tomcat-6.0-doc/logging.html我需要在tomcat中將stdout重定向到一個文件,以便Intellij可以查看它。 – benstpierre 2010-06-22 19:28:37