How to capture post method request in access log file?

我的梦境 提交于 2019-12-10 11:46:54

问题


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" />

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.

Thanks in advance !


回答1:


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

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" />

More details are available here: Tomcat Access Valves.

Hope this helps!!



来源:https://stackoverflow.com/questions/12855184/how-to-capture-post-method-request-in-access-log-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!