How to enable date and time in the gc.log?

Solution Unverified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x
  • Java

Issue

  • How to enable date and time in the gc.log ?
  • How to enable date stamp in gc.log ?

Resolution

While enabling the gc log , add -XX:+PrintGCDateStamps JVM_OPTION in standalone.conf file if JBoss is running in standalone mode and in domain mode add this -XX:+PrintGCDateStamps option as given in link https://access.redhat.com/solutions/18656 to enable gc in domain mode :

-verbose:gc -Xloggc:gc.log.`date +%Y%m%d%H%M%S` -XX:+PrintGCDetails -XX:+PrintGCDateStamps

Enabling -XX:+PrintGCDateStamps instead of -XX:+PrintGCTimeStamps for JAVA_OPTS option , will print the date stamps :

-XX:-PrintGCTimeStamps 	:    Print timestamps at garbage collection. Manageable (Introduced in 1.4.0.)
-XX:+PrintGCDateStamps   :   Print date stamps at garbage collection events (e.g. 2011-09-08T14:20:29.557+0400: [GC... )
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.