WildFly and Garbage Collection Logging: Difference between revisions
No edit summary |
|||
(15 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=External= | |||
* How to enable Garbage Collection (GC) logging in EAP 6 domain mode https://access.redhat.com/solutions/269023 | |||
* Preventing GC log file overwrites upon restart in domain mode https://access.redhat.com/solutions/1325293 | |||
* How to rotate gc log file configured in domain mode in EAP 6? https://access.redhat.com/solutions/1132613 | |||
=Internal= | =Internal= | ||
Line 10: | Line 16: | ||
=Enabling GC Logging in Standalone Mode= | |||
<font color=red>TODO</font>. | |||
=Enabling GC Logging in Domain Mode= | =Enabling GC Logging in Domain Mode= | ||
==Server Node== | |||
The GC logging can be enabled for a specific server node, or generically, across the server group. | |||
To enable GC logging for just one server node, modify the corresponding [[Host.xml#.3Cjvm.3E|<jvm>]] declaration in the [[Host.xml#.3Cjvm.3E|host.xml]] file. | |||
To enable GC logging for an entire server group, edit the [[Domain.xml#.3Civm-options.3E|<ivm-options>]] section corresponding to the [[Domain.xml#.3Cjvm.3E|<jvm>]] configuration specified for the server group, in [[Domain.xml#.3Cjvm.3E|domain.xml]]. | |||
In both cases, add the following JVM options: | |||
<pre> | |||
<jvm-options> | |||
<option value="-verbose:gc"/> | |||
<option value="-Xloggc:/opt/jdg/domain/servers/server/log/gc.log"/> | |||
<option value="-XX:+PrintGCDetails"/> | |||
<option value="-XX:+PrintGCDateStamps"/> | |||
</jvm-options> | |||
</pre> | |||
<blockquote style="background-color: Gold; border: solid thin Goldenrod;"> | |||
:<br>Option values cannot contain system properties, they cannot be resolved: | |||
: <tt>java.lang.IllegalStateException: WFLYCTL0211: Cannot resolve expression '-Xloggc:/opt/jdg/domain/servers/${jboss.server.name}/log/gc.log'</tt><br><br> | |||
</blockquote> | |||
===Log File Path Specification=== | |||
Option values cannot contain system property declarations, so the the paths can only be specified generically (in the server group) if the directory layout is homogeneous across the whole server group. | |||
In case the server names are different, the GC paths can be specified in individual, host specific, host.xml. | |||
One solution that works well in case there's just a single server node per host is to create a symbolic link /opt/eap/domain/servers/server -> /opt/eap/domain/servers/<server-name>, and then use: | |||
<pre> | |||
[...] -Xloggc:/opt/eap/domain/servers/server/log/gc.log [...] | |||
</pre> | |||
==Host Controller== | |||
<font color=red>TODO</font>. |
Latest revision as of 17:43, 1 November 2016
External
- How to enable Garbage Collection (GC) logging in EAP 6 domain mode https://access.redhat.com/solutions/269023
- Preventing GC log file overwrites upon restart in domain mode https://access.redhat.com/solutions/1325293
- How to rotate gc log file configured in domain mode in EAP 6? https://access.redhat.com/solutions/1132613
Internal
Overview
GC logging is enabled by default for standalone mode (to verify form which version on). It generates output to $JBOSS_HOME/standalone/log/gc.log.<digit>. The system uses log rotation with the number of log files limited to 5, and the size of each file limited to 3 MB.
Enabling GC Logging in Standalone Mode
TODO.
Enabling GC Logging in Domain Mode
Server Node
The GC logging can be enabled for a specific server node, or generically, across the server group.
To enable GC logging for just one server node, modify the corresponding <jvm> declaration in the host.xml file.
To enable GC logging for an entire server group, edit the <ivm-options> section corresponding to the <jvm> configuration specified for the server group, in domain.xml.
In both cases, add the following JVM options:
<jvm-options> <option value="-verbose:gc"/> <option value="-Xloggc:/opt/jdg/domain/servers/server/log/gc.log"/> <option value="-XX:+PrintGCDetails"/> <option value="-XX:+PrintGCDateStamps"/> </jvm-options>
Option values cannot contain system properties, they cannot be resolved:- java.lang.IllegalStateException: WFLYCTL0211: Cannot resolve expression '-Xloggc:/opt/jdg/domain/servers/${jboss.server.name}/log/gc.log'
Log File Path Specification
Option values cannot contain system property declarations, so the the paths can only be specified generically (in the server group) if the directory layout is homogeneous across the whole server group.
In case the server names are different, the GC paths can be specified in individual, host specific, host.xml.
One solution that works well in case there's just a single server node per host is to create a symbolic link /opt/eap/domain/servers/server -> /opt/eap/domain/servers/<server-name>, and then use:
[...] -Xloggc:/opt/eap/domain/servers/server/log/gc.log [...]
Host Controller
TODO.