如何捕获访问日志文件中的发布方法请求? [英] How to capture post method request in access log file?

查看:405
本文介绍了如何捕获访问日志文件中的发布方法请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过取消注释server.xml文件中的以下代码来启用jboss Server中的访问日志

I am enabling the access log in jboss Server by uncommenting the below code in server.xml file

       <Valve className="org.apache.catalina.valves.AccessLogValve"
        prefix="localhost_access_log." suffix=".log"
        pattern="common" directory="${jboss.server.home.dir}/log" 
        resolveHosts="false" />

每天都会创建访问日志. 我可以在访问日志文件中看到get方法请求,但是看不到post方法请求.如何在jboss的服务器访问日志文件中捕获后方法请求的详细信息.

Access logs are creating on the daily basis. I am able to see get method request in access log file but not able to see post method request. How can I capture the details of post method request in server access log file in jboss.

提前谢谢!

推荐答案

您正在将pattern用作common,与'%h %l %u %t "%r" %s %b等效.

You are using pattern as common which is equivalents to '%h %l %u %t "%r" %s %b.

还有另一个模式属性%m->用于Request方法(GET,POST等),将其添加到您的模式中,例如

There is another pattern attribute %m --> for Request method (GET, POST, etc.) add that to your pattern e.g.

   <Valve className="org.apache.catalina.valves.AccessLogValve"
    prefix="localhost_access_log." suffix=".log"
    pattern="'%h %l %u %t "%r" %s %b %m" directory="${jboss.server.home.dir}/log" 
    resolveHosts="false" />

更多详细信息,请参见: Tomcat检修阀 .

More details are available here: Tomcat Access Valves.

希望这会有所帮助!

这篇关于如何捕获访问日志文件中的发布方法请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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