现在看来您需要 PHD 才能理解 Tomcat 日志记录...叹息。在我的一个 Eclipse/WTP 项目中,Tomcat 记录每个请求(之前和之后):
...
13.02.2012 20:50:47 org.apache.catalina.core.ApplicationContext log
INFO: After request [uri=/demo-webmvc-web/scripts/libs/jquery/jquery-1.6.4.min.js?null]
13.02.2012 20:50:47 org.apache.catalina.core.ApplicationContext log
INFO: Before request [uri=/demo-webmvc-web/images/logo.gif?null]
13.02.2012 20:50:47 org.apache.catalina.core.ApplicationContext log
INFO: After request [uri=/demo-webmvc-web/images/logo.gif?null]
...
我该如何摆脱它?
最佳答案
原来有人在web.xml
中配置了org.springframework.web.filter.ServletContextRequestLoggingFilter
。由于此过滤器调用
filterConfig.getServletContext().log()
并且因为 Servlet 上下文是 org.apache.catalina.core.ApplicationContext
类型,所以它是出现在日志消息中的类
13.02.2012 20:50:47 org.apache.catalina.core.ApplicationContext log ...
这让我相信日志记录是由 Tomcat 本身触发的。
关于eclipse - 如何在 Eclipse 中禁用 Tomcat 请求日志记录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9267130/