I am facing a problem regarding server.log file generation in Wildfly-8.2.0.Final AS.
Below is the size-rotating-file-handler
definition used in logging subsystem <subsystem xmlns="urn:jboss:domain:logging:2.0">
of standalone-full-ha.xml.
<size-rotating-file-handler name="FILE" autoflush="false">
<level name="DEBUG"/>
<file relative-to="jboss.server.log.dir" path="server.log"/>
<rotate-size value="500k"/>
<max-backup-index value="5"/>
<append value="true"/>
</size-rotating-file-handler>
The above works fine and it generates server.log in ${WILDFLY_HOME}/standalone/log folder. I would like to have a custom location for server.log and hence, modified the path attribute to contain the complete custom path and removed relative-to attribute as shown below.
<file path="D:/wildfly-8.2.0.Final/standalone/log/server.log"/>
But, with the above changes, server.log is getting generated in custom location but facing the below problems:
log statements are getting generated without date in it. for e.g.:
12:16:11,800 INFO [org.jboss.as] (MSC service thread 1-7) JBAS015899: WildFly 8.2.0.Final "Tweek" starting
Complete logs are not observed in the log file and for example, "server is started..." will be the last line and a quarter of the log statements are not printed.
Please help me.
Edited on 10/May/2016: added the below configuration.
<subsystem xmlns="urn:jboss:domain:logging:2.0">
<add-logging-api-dependencies value="false"/>
<use-deployment-logging-config value="true"/>
<console-handler name="CONSOLE">
<level name="INFO"/>
<formatter>
<named-formatter name="PATTERN"/>
</formatter>
</console-handler>
<size-rotating-file-handler name="FILE" autoflush="false">
<level name="DEBUG"/>
<file path="${custom.path}/server.log"/>
<rotate-size value="500k"/>
<max-backup-index value="5"/>
<append value="false"/>
<formatter>
<named-formatter name="PATTERN"/>
</formatter>
</size-rotating-file-handler>
<logger category="com.arjuna">
<level name="WARN"/>
</logger>
<logger category="org.apache.tomcat.util.modeler">
<level name="WARN"/>
</logger>
<logger category="org.jboss.as.config">
<level name="DEBUG"/>
</logger>
<logger category="sun.rmi">
<level name="WARN"/>
</logger>
<logger category="jacorb">
<level name="WARN"/>
</logger>
<logger category="jacorb.config">
<level name="ERROR"/>
</logger>
<root-logger>
<level name="INFO"/>
<handlers>
<handler name="CONSOLE"/>
<handler name="FILE"/>
</handlers>
</root-logger>
<formatter name="PATTERN">
<pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
</formatter>
<formatter name="COLOR-PATTERN">
<pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
</formatter>
</subsystem>
Seems that you did not specified a pattern (and probably this is why the date/time are not in the log).
<size-rotating-file-handler name="FILE" autoflush="false">
<level name="DEBUG"/>
<file path="D:/wildfly-8.2.0.Final/standalone/log/server.log"/>
<rotate-size value="500k"/>
<max-backup-index value="5"/>
<append value="true"/>
<formatter>
<named-formatter name="PATTERN"/>
</formatter>
</size-rotating-file-handler>
Pattern example with date/time:
<formatter name="PATTERN">
<pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
</formatter>
Can you provide full log configuration? Maybe the "server is started..." is not showing because you didnt put the file handler in right category.