Problem :
Moving from JDK 8 to JDK 11 is quiet subtle. One issue which many people have faced is regarding is GC Logs.
Solution :
JDK 11 uses generic logging mechanism. So flags like PrintGCDetails, PrintGCDateStamps don’t work anymore. The new format is easy to use once you understand it.
Format is :
[tag selection][:[output][:[decorators][:output-options]]]
There are 4 sections to it :
- What operation do you want to log and what level you want to log.
- Where do you want to log.
- What parameter’s you want to log.
- Any additional options.
For e.g.
-Xlog:gc:file=/var/logs/gc.log:utctime,pid,level,tags:filecount=3,filesize=100M
In the above case, we wanted to see gc logs at specified log file showing mentioned variable with max of 3 back up files to be rolled when main file reached 100 MB.
More information is available at : https://docs.oracle.com/javase/9/tools/java.htm#JSWOR-GUID-BE93ABDC-999C-4CB5-A88B-1994AAAC74D5