Issue
I used the -Xlog:gc:file
option in my script file to log GC data in a file and I do not want this file to rotate everytime I execute the script file.
However with the following property I can see the file is creating PrintGC.log.X (X is a number) files each time I execute the script file.
$JVM_MEM_OPTS \
-Xlog:gc:file="$CARBON_HOME/repository/logs/printGC.log":time \
Any help that can disable this file rotation?
Solution
You are using Java 11+ logging options, and asking about Java 11.
In Java 11 (and later) you need this:
-Xlog:gc:file="$CARBON_HOME/repository/logs/printGC.log"::filecount=0:time
According to Enable Logging with the JVM Unified Logging Framework, the ::filecount=0
should disable log rotation.
Answered By - Stephen C
Answer Checked By - Gilberto Lyons (JavaFixing Admin)