We have two web applications deployed (named A and B) on the same application server (WildFly 8.1) with configuration shown below.
We have the same access-log configuration for both hosts. Now the problem is that WildFly either logs application A in access_log.log or it logs application B in access_log.log, but not both.
If the application A logs are getting logged in access_log.log, then WildFly picks the access log from the previous day (e.g. access_log.2018-23-09.log) for application B. And even when both applications are writing to access_log.log, the timestamps are not sorted properly.
Below is the host configuration
<host name="default-host" alias="b.xyz.com">
<access-log pattern="%{i,X-Forwarded-For} %l %u [%t] %D "%r" %s %b "%{i,Referer}" "%{i,User-Agent}""/>
</host>
<host name="ui-host" alias="a.xyz.com" default-web-module="ui-server.war">
<access-log pattern="%{i,X-Forwarded-For} %l %u [%t] %D "%r" %s %b "%{i,Referer}" "%{i,User-Agent}""/>
</host>
I was able to figure it out by giving using the prefix attribute within access_log tag. I gave different prefix values to different host which are there in the wildfly and now they are writing to different files which seems to have solve the problem.