6
在我們的系統(封閉系統,tomcat 6中的java web應用程序作爲服務器,java胖客戶端)中,我們的客戶偶爾會出現「400 - 錯誤請求」響應。我想在服務器端進行調試,但由於請求似乎無效,所以我沒有在任何地方看到它們。我爲完整的tomcat主機配置了AccessLogValve,但請求沒有出現在那裏。我甚至沒有在catalina.out中看到任何東西。如何在tomcat中記錄/調試不良請求?
我很想讓這些請求記錄下來,甚至更好的是根據某些標準轉儲請求。
任何想法?
我server.xml中看起來是這樣的:
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="off" />
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"
rmiServerPortPlatform="9098"
rmiRegistryPortPlatform="9099"
useLocalPorts="true" />
<Service name="Catalina">
<Connector port="8020" protocol="HTTP/1.1" redirectPort="8010" connectionTimeout="20000" />
<Engine name="Catalina" defaultHost="localhost" jvmRoute="cc1">
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="false"
deployOnStartup="true" xmlValidation="false" xmlNamespaceAware="false">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="access_log."
suffix=".txt" pattern="combined" resolveHosts="false" />
</Host>
</Engine>
</Service>
</Server>
RequestDumperValve是一個很好的調試解決方案,但要注意與它發生的一些問題。作爲一個例子,Umlauts被修改:https://issues.apache.org/bugzilla/show_bug.cgi?id=40177 –
RequestDumperValve似乎已經在Tomcat 7中被刪除。 –