如何将 jconsole 输出保存在日志文件中?
我尝试添加logging.properties,但它已被忽略:
jconsole.exe -Jjava.util.logging.config.file=logging.properties -debug
或
jconsole.exe -Djava.util.logging.config.file=logging.properties -debug
目前,我正在获得具有最少日志的 Jconsole 输出窗口,如下所示:
java.lang.SecurityException: Expecting a javax.rmi.ssl.SslRMIClientSocketFactory RMI client socket factory in stub!
at javax.management.remote.rmi.RMIConnector.checkStub(RMIConnector.java:1875)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:295)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)
at sun.tools.jconsole.ProxyClient.tryConnect(ProxyClient.java:357)
at sun.tools.jconsole.ProxyClient.connect(ProxyClient.java:313)
at sun.tools.jconsole.VMPanel$2.run(VMPanel.java:294)
sorting table against column=0 ascending=true
sorting table against column=0 ascending=true
sorting table against column=0 ascending=true
我也可以选择抑制,但我不想要它
使用"--控制台抑制"来抑制控制台输出。
要启动jvisualvm
并登录到文件,您可以创建一个logging.properties
文件
.level= FINER
handlers= java.util.logging.FileHandler
java.util.logging.FileHandler.pattern = jvisualvm.log
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
并将jvisualvm
开头
jvisualvm -J-Djava.util.logging.config.file=logging.properties