Eclipse RCP客户端并将控制台重定向到文件

时间:2023-01-20 19:29:09

I'm running an Eclipse RCP application. I've enabled the flags -console -consolelog -debug and now it's humming along logging to it's console.

我正在运行Eclipse RCP应用程序。我已经启用了标志-console -consolelog -debug,现在它正在记录到它的控制台。

However, I'd like it to log to a file. If I start the application from within the Eclipse IDE, I can select a file for it to redirect the console to. There must be some equivalent flag och property I can put in the config.ini file for the exported RCP application.

但是,我希望它能够登录到文件。如果我从Eclipse IDE中启动应用程序,我可以选择一个文件来将控制台重定向到。必须有一些等效的标志och属性,我可以将其放在config.ini文件中,用于导出的RCP应用程序。

1 个解决方案

#1


2  

Are you using a logging framework like commons-logging or log4j? If so, those will have options to log to different locations, and that would probably be the best way to manage this. (It would work the same in all environments).

您使用的是commons-logging或log4j等日志框架吗?如果是这样,那些将有选项登录到不同的位置,这可能是管理这个的最佳方式。 (它在所有环境中都会起作用)。

If you need help setting up a logger in an rcp/OSGi app, take a look at this question:

如果您需要在rcp / OSGi应用程序中设置记录器的帮助,请查看以下问题:

Logging in Eclipse/OSGi plugins

登录Eclipse / OSGi插件

#1


2  

Are you using a logging framework like commons-logging or log4j? If so, those will have options to log to different locations, and that would probably be the best way to manage this. (It would work the same in all environments).

您使用的是commons-logging或log4j等日志框架吗?如果是这样,那些将有选项登录到不同的位置,这可能是管理这个的最佳方式。 (它在所有环境中都会起作用)。

If you need help setting up a logger in an rcp/OSGi app, take a look at this question:

如果您需要在rcp / OSGi应用程序中设置记录器的帮助,请查看以下问题:

Logging in Eclipse/OSGi plugins

登录Eclipse / OSGi插件