My Oracle Support Banner

GC Log File Name Can Append a Timestamp Beginning with Java SE 7u76 (Doc ID 2189493.1)

Last updated on OCTOBER 18, 2022

Applies to:

Java SE JDK and JRE - Version 7 to 8
Information in this document applies to any platform.


When using the  java command line argument -Xloggc to specify a GC log file name, it is often desirable to include the log file's creation date and time (timestamp) in the log file name.  This will prevent a log file from being overwritten upon a restart of the application.  The timestamp can be added to the log file name with the %t notation as follows:


This works for Java SE 7 Update 76 (7u76) and newer updates, as well as all updates of Java SE 8, where the expected timestamp is entered in the log file name.  For example:


However, trying to use it in older versions causes the "%t" to be included verbatim in the log file as follows:



To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.