start应用程序日志重定向到文件

start应用程序日志重定向到文件

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

问题描述

我们有一个应用程序可以通过我们办公室内部的Java web start启动。

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.

可能吗?

以及如何做到这一点?

PS:应用程序的设计如下:访问服务器上的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.

推荐答案

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应用程序日志重定向到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 00:17