Forum Stats

  • 3,757,144 Users
  • 2,251,200 Discussions
  • 7,869,743 Comments

Discussions

Java 11 GC Log Level Output

User_I6RFC
User_I6RFC Member Posts: 1 Green Ribbon

I am using java 11 for my application. To monitor the performance of my application, I enabled the GC logging configuration as -

-Xlog:gc*:file=gc.log:time,uptime,level,tags:filecount=10,filesize=2m

As per this, the default log level is INFO. But when I try to generate the logs in the file with WARNING & ERROR, it does not generate anything, even if there is an Out Of Memory Error. Even with the INFO level, it is not showing the WARNING or ERROR. By default the output for WARNING or ERROR goes to STDERR.

  1. Is it possible to get these WARNING or ERROR logs in a file and if it is, how to do it ?
  2. What is the best log level to monitor the GC logs in production environment ?