将 java web start 应用程序日志重定向到文件 [英] redirecting a java web start app logs to a file

查看:38
本文介绍了将 java web start 应用程序日志重定向到文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个应用程序,我们可以在我们办公室内部通过 Java 网络访问该应用程序.

We have an application that we access over Java web start internally at our office.

应用产生的所有日志都显示在 Firefox 的控制台中.

all the logs produced by the app are displayed in Firefox's console.

我想要做的是将它重定向到一个文件.

what I want to do is to redirect that to a file.

这可能吗?

以及如何做到这一点?

P.S:应用程序设计如下:访问服务器上的 EJB 的客户端应用程序.

P.S : the application is designed as follow : a client app that accesses an EJB on a server.

客户端部分是通过 java webstart 提供的部分.

the client part is the one made available through java webstart.

推荐答案

我想使用 System.setOut 方法可以将所有 System.out.println() 输出重定向到一个文件.

I figured using the System.setOut method could be used to redirect all System.out.println() outputs to a file.

因此,这可以在我的应用中使用:

Hence, this could be used in my app :

        System.setOut(new PrintStream("C:\\log.txt"));

这篇关于将 java web start 应用程序日志重定向到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆