Spring

 how to we enable VERBOSE LOGGING in Springboot app to get garbage collection logs?

vinnu arige's profile image
vinnu arige posted Sep 05, 2019 04:42 PM

 

Daniel Mikusa's profile image
Daniel Mikusa

Verbose or debugging logging for a Spring Boot isn't going to get you garbage collection information. You would need to set the JVM flags to enable garbage collection logging.

-XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps

You can also add `-Xloggc:/path/to/file.log` if you'd like to write the information to a file. Otherwise it just goes to STDOUT.

 

Where you put the JVM flags entirely depends on where you are running your app and how you are starting it up.

 

Hope that helps!