Feedback requested: HotSpot GC logging improvements

Johann N. Loefflmann Johann.Loefflmann at Sun.COM
Fri May 7 02:05:42 PDT 2010


Tony,

> B. Introducing "cyclic" GC logs.
>   
For the Java Fatal Error Log we can specify %p, for example:

-XX:ErrorFile=/var/log/java/java_error%p.log

IMHO it would be great if we could use %p also for

-Xloggc:/var/log/java/gc%p.log

See also
http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/felog.html#gbwcy

IMHO options in order to configure the format of the gc log filename 
would be more
comfortable for an user than only hardcoding a particular schema. Proposal:

%p   the process ID
%t   a timestamp (the format could be controlled by a new option,
        I suggest -XX:TimeStampFormatForLogFileNames)
%n   an index or sequential number

I suggest a default for the timestamp format, something like

-XX:TimeStampFormatForLogFileNames=yyyy-MM-dd_HH-mm-ss

because digits, hypen and underscore are file system independent, the 
format is
human readable and the default can be changed by specifying the option 
if the default is
not suitable. Furthermore, the option could be used by any log and not 
just only
the gc log (the fatal error log for example).

Pattern letters for the option could be borrowed from the 
SimpleDateFormat class. See also
http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html

I'm sure that customer would find it quite comfortable to specify 
something like that

-Xloggc:/var/log/java/gclog_pid%p_%n_%t.log

-Johann
(Software TSC Support engineer)



More information about the hotspot-gc-use mailing list