Applies to
Anyone who has moved to Java 11 or 17 and requires GC logging.
Instructions
In the old GC (Java 8 and prior) logging settings, you would use something similar to:
-Xloggc:/var/log/cloudera-scm-server/gc.log
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-XX:+PrintGCDateStamps
In Java 11 and 17 this will actually cause an error as these are no longer used. To get similar output we recommend:
-Xlog:gc*,time:file=/var/log/cloudera-scm-server/gc-%t.log
where gc* will log anything related to GC up to INFO level
time will give the equivilant data that used to be PrintGCTimeStamps and PrintGCDateStamps
file will allow you to set an output file and it's location
%t gives you a date stamp in the file name on creation (ex. gc-2025-05-23_11-56-54.log)