jboss 7.x 记录请求日志 和post数据

参考 https://stackoverflow.com/questions/14152742/is-there-a-way-to-log-http-post-data-in-jboss-7-1-1

访问日志

standlone.xml

<subsystem xmlns="urn:jboss:domain:web:1.0" ....>
    <connector name="http" ... />
    <virtual-server name="default-host" enable-welcome-root="true">
        <whatever aliases you may have defined />
        <access-log>
            <directory relative-to="jboss.server.log.dir"/>
        </access-log>
    </virtual-server>
</subsystem>

记录post数据

单项目
WEB-INF\jboss-web.xml

<valve>
        <class-name>org.apache.catalina.valves.RequestDumperValve</class-name>
</valve>

jboss全局
standlone.xml

<subsystem xmlns="urn:jboss:domain:web:1.4"...>
添加
<valve name="RequestLogging" module="org.jboss.as.web" class-name="org.apache.catalina.valves.RequestDumperValve"/>

© 2018, 新之助meow. 原创文章转载请注明: 转载自http://www.xinmeow.com

0.00 avg. rating (0% score) - 0 votes
点赞