logging - Dump HTTP requests in WildFly 8 -
logging - Dump HTTP requests in WildFly 8 -
to debug http requests during development, i wildfly 8 application server dump http requests, including request method , headers, log file. server.log
fine.
in sources of wildfly's http subsystem, found requestdumpinghandler , corresponding logging category io.undertow.request.dump
however, cannot figure out, how install header applied requests served application (a war static resources , jax-rs handler).
the corresponding documentation page (undertow web subsystem configuration) doesn't explain handlers. there <handler>
element in configuration section
<?xml version="1.0" ?> <server xmlns="urn:jboss:domain:2.1"> ... <profile> ... <subsystem xmlns="urn:jboss:domain:undertow:1.1"> <buffer-cache name="default"/> <server name="default-server"> <http-listener name="default" socket-binding="http"/> <host name="default-host" alias="localhost"> <location name="/" handler="welcome-content"/> <filter-ref name="server-header"/> <filter-ref name="x-powered-by-header"/> </host> </server> <servlet-container name="default"> <jsp-config/> </servlet-container> <handlers> <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/> <!-- <dump-request /> ?? or something?--> </handlers> <filters> <response-header name="server-header" header-name="server" header-value="wildfly/8"/> <response-header name="x-powered-by-header" header-name="x-powered-by" header-value="undertow/1"/> </filters> </subsystem> ... </profile> ... </server>
but far can tell, <file>
, proxy expected there(?).
how can log total details of incoming http requests in wildfly? know install logging mechanism @ jax-rs layer, have 1 dump mechanism handles both rest api calls , statically served resources.
you need add together requestdumpinghandler handler chain.
as part of wildfly 8.1, not yet possible in friendly way.
this improved in 8.2 , 9 able configure adding this:
<host name="default-host" > ..... <filter-ref name="request-dumper"/> </host> .... <filters> ... <filter name="request-dumper" class-name="io.undertow.server.handlers.requestdumpinghandler" module="io.undertow.core" /> </filters>
in 8.1 alternative add together servletextension http://undertow.io/documentation/servlet/servlet-extensions.html
that add together requestdumpinghandler outer chain.
fwiw 8.2 release ready, wait or build sources 8.x branch.
logging wildfly wildfly-8
Comments
Post a Comment