Kohei Nozaki's blog 

Enabling RequestDumpingHandler of Undertow


Posted on Friday Mar 20, 2015 at 05:01PM in WildFly


Tested with WildFly 8.2.0.Final. Issue following command via jboss-cli and restart the server:

/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

Following log will be dumped to the console:

----------------------------REQUEST---------------------------
               URI=/batcheetest/jbatch/batchee/execution/start/myjob
 characterEncoding=null
     contentLength=95
       contentType=[application/json]
            header=Accept=*/*
            header=Content-Type=application/json
            header=Content-Length=95
            header=User-Agent=curl/7.30.0
            header=Host=localhost:8080
            locale=[]
            method=POST
          protocol=HTTP/1.1
       queryString=
        remoteAddr=/127.0.0.1:57668
        remoteHost=localhost
            scheme=http
              host=localhost:8080
        serverPort=8080
--------------------------RESPONSE--------------------------
     contentLength=-1
       contentType=application/json
            header=Connection=keep-alive
            header=X-Powered-By=Undertow/1
            header=Server=WildFly/8
            header=Transfer-Encoding=chunked
            header=Content-Type=application/json
            header=Date=Fri, 20 Mar 2015 07:58:13 GMT
            status=200
==============================================================

I’m disappointed that there is no dump of request body :(



No one has commented yet.

Leave a Comment

HTML Syntax: NOT allowed