Dump HTTP requests in WildFly 8

前端 未结 3 1404
死守一世寂寞
死守一世寂寞 2020-12-05 10:20

To debug HTTP requests during development, I would like my WildFly 8 application server to dump HTTP requests, including request method and headers, to a log file

3条回答
  •  伪装坚强ぢ
    2020-12-05 11:09

    You would need to add RequestDumpingHandler to your handler chain.

    As part of wildfly 8.1, that is not yet possible in a friendly way.

    This is improved in 8.2 and 9 so you will be able to configure this by adding something like this:

    
         .....
         
    
    ....
    
        ...
        
    
    

    in 8.1 only option now would be to add ServletExtension http://undertow.io/undertow-docs/undertow-docs-1.2.0/#servlet-extensions

    that would add this RequestDumpingHandler to outer chain.

    FWIW 8.2 release is almost ready, so you could wait for it or just build sources for 8.x branch.

    To add above config via CLI, you can use:

    /subsystem=undertow/configuration=filter/custom-filter=request-dumper:add(class-name="io.undertow.server.handlers.RequestDumpingHandler",  module="io.undertow.core")
    /subsystem=undertow/server=default-server/host=default-host/filter-ref=request-dumper:add
    

提交回复
热议问题