Tomcat上的Grails - 如何记录原始HTTP请求/响应 [英] Grails on Tomcat - How to log raw HTTP request/response

查看:114
本文介绍了Tomcat上的Grails - 如何记录原始HTTP请求/响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法找到配置我的虚拟教程Grails应用程序的方式,以记录Grails服务器(实际上是Tomcat)接受/生成的所有HTTP请求和响应。这可能吗?

解决方案

另一个选择是使用tomcat内置的访问日志记录。 b $ b

http://tomcat.apache.org /tomcat-6.0-doc/config/valve.html#Access_Log_Valve



我自己使用这个,它是相当可配置的。



如何配置tomcat 6

 < Valve className =org.apache.catalina.valves.AccessLogValvedirectory =logs
prefix =localhost_access_log。 suffix =。txtpattern =commonresolveHosts =false/>

将此添加到标签为主机下的server.xml配置文件的末尾。


I couldn't find the way to configure my dummy tutorial Grails application to log all HTTP requests and responses accepted/generated by Grails server (actually - Tomcat). Is this possible?

解决方案

Another option would be to use tomcat's built in access logging.

http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Access_Log_Valve

Im using this myself, and it is quite configurable.

How to configure tomcat 6

 <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"  
               prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>

Add this to the end of your server.xml config under the tag "Host".

这篇关于Tomcat上的Grails - 如何记录原始HTTP请求/响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆