How to write GC log for named pipe in Java 9?

Before Java9, we can simply specify -Xloggc: / my / named / pipe to write garbage collection messages to named pipe . However, when specifying -Xlog:gc*:file=/my/named/pipe JVM 9 complains about the named pipe:

 [0.003s][error][logging] Unable to log to file /my/named/pipe, /my/named/pipe is not a regular file. 

We are using Linux RedHat with jdk_9.0.1_x64.

How can we write GC messages to a named pipe in Java 9?

+5
source share
1 answer

Having looked at the syntax specified in Unified JVM Logging , you can try to replace arg from

 -xlog:gc*.file=/my/named/pip 

to

 -Xlog:gc*=info:file=gctrace.txt ^ ^ ^ level colon filename 

or simply

 -Xlog:gc*:file=gctrace.txt // since default level for gc logging is INFO 
+1
source

Source: https://habr.com/ru/post/1274622/


All Articles