VOOZH about

URL: https://www.javacodegeeks.com/2020/11/gc-logs-changes-for-migrating-from-jdk-8-to-jdk-11.html

⇱ GC Logs changes for migrating from JDK 8 to JDK 11 - Java Code Geeks


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 :

1
[tag selection][:[output][:[decorators][:output-options]]]

There are 4 sections to it :

  1. What operation do you want to log and what level you want to log.
  2. Where do you want to log.
  3. What parameter’s you want to log.
  4. Any additional options.

For e.g.

1
-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

Published on Java Code Geeks with permission by Abhijeet Iyengar, partner at our JCG program. See the original article here: GC Logs changes for migrating from JDK 8 to JDK 11.

Opinions expressed by Java Code Geeks contributors are their own.

Do you want to know how to develop your skillset to become a Java Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
6. Spring Interview Questions
7. Android UI Design
and many more ....
I agree to the Terms and Privacy Policy

Thank you!

We will contact you soon.

πŸ‘ Photo of Abhijeet Iyengar
Abhijeet Iyengar
November 13th, 2020Last Updated: November 9th, 2020
0 3,261 1 minute read

Abhijeet Iyengar

Abhijeet is a Software Engineer working with financial client . He has been involved in building UI and service based applications.
Subscribe

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Back to top button
Close
wpDiscuz