Log all HTTP requests of Tomcat Server?

后端 未结 3 1084
伪装坚强ぢ
伪装坚强ぢ 2020-12-31 13:28

Is it possible to print all requests to Tomcat and responses from Tomcat in a logfile?

ex:

request

headers: [

3条回答
  •  不知归路
    2020-12-31 14:19

    https://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Request_Dumper_Filter

    The Request Dumper Filter logs information from the request and response objects and is intended to be used for debugging purposes.

    The following entries in a web application's web.xml would enable the Request Dumper filter for all requests for that web application.

    If the entries were added to CATALINA_BASE/conf/web.xml, the Request Dumper Filter would be enabled for all web applications.

    
        requestdumper
        
            org.apache.catalina.filters.RequestDumperFilter
        
    
    
        requestdumper
        *
    
    

提交回复
热议问题