java log控制台输出到文件,如何将Java控制台输出传递给文件?

I found a bug in an application that completely freezes the JVM. The produced stacktrace would provide valuable information for the developers and I would like to retrieve it from the Java console. When the JVM crashes, the console is frozen and I cannot copy the contained text anymore.

Is there way to pipe the Java console directly to a file or some other means of accessing the console output of a Java application?

Update: I forgot to mention, without changing the code. I am a manual tester.

Update 2: This is under Windows XP and it's actually a web start application. Piping the output ofjavaws jnlp-url does not work (empty file).

解决方案

Actually one can activate tracing in the Java Control Panel. This will pipe anything that ends up in the Java console in a tracing file.

The log files will end up in:

/.java/deployment/log on Unix/Linux

\Sun\Java\Deployment\log on Windows

/~/Library/Caches/Java/log on OS X

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值