当java虚拟机崩溃时,在特定目录(不同于类目录)中编写hs_err_pid * .log是可行的吗? [英] It is posible to write hs_err_pid*.log in a specific directory (different than the class directory) when java virtual machine crash?
问题描述
当java虚拟机外部的java应用程序崩溃时,在与运行的类相同的目录中生成日志文件hs_err_pidXXXX.log。
When a java application crash outside the java virtual machine generate a log file hs_err_pidXXXX.log in the same directory than the class running.
它可以在不同的目录中生成这个文件吗?
It's posible generate this file in a different directory?
我的客户想要更改为只读这个目录,但我不想丢失这些文件。
My client want to change to read only this directory, but i don't like to lose this files.
推荐答案
我认为-XX:ErrorFile JVM arg可以正常工作。
I think the -XX:ErrorFile JVM arg will work.
请参阅 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5107646和 http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid = 5515dc81f6e66149b8cd377f59bf1?bug_id = 4872551 了解详情
http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html 包含VM选项列表(感谢@PeterŠtibraný谁是谁先前的回答添加了此链接)
http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html contains a list of VM options (Thanks @Peter Štibraný who's earlier answer added this link)
这篇关于当java虚拟机崩溃时,在特定目录(不同于类目录)中编写hs_err_pid * .log是可行的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!