In order to enable access logs in Wildfly 8.1,Please refer below steps:
- Go to WILDFLY_HOME/standalone/configuration folder.
- Open Standalone.xml and put following snippet under <subsystem xmlns="urn:jboss:domain:undertow:1.2">
<subsystem xmlns="urn:jboss:domain:undertow:1.2">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http" record-request-start-time="true"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<access-log pattern="%h	%p	%l	%u	%t	"%r"	%s	%b	"%{i,Referer}"	"%{i,User-Agent}"&#x
9;%D	"%{i,X-Forwarded-For}"	"%{i,True-Client-IP}"	"%{i,JSESSIONID}c"" directory="${jboss.server.log.dir}" prefix="access-log"
worker="default" rotate="true"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
</host>
</server>
<servlet-container name="default">
<jsp-config/>
<websockets/>
</servlet-container>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
</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>