配置eclipse osgi日志

发布于 2024-12-06 11:16:46 字数 760 浏览 1 评论 0原文

我正在使用 eclipse osgi jar。 如何将osgi生成的日志重定向到文件

每当我启动osgi框架时,它都会生成类似1317008078357.log的日志。如何将此日志重定向到自定义文件。我需要使用 log4j 作为 osgi 包吗? log4j.xml 配置是什么?

日志文件包含:

!SESSION 2011-09-26 11:34:38.232 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_26
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments:  -configuration D:/CommonNBI/Trunck/release_structure/server/nbi/snmp/conf -console
!ENTRY org.eclipse.osgi 2 0 2011-09-26 11:34:44.029
!MESSAGE While loading class .... may not be fully initialized.
!STACK 0
org.osgi.framework.BundleException: State change in progress for bundle ..

I am using eclipse osgi jar. How to redirect the log generated by osgi to a file?

Whenever I start the osgi framework, it generates a log like 1317008078357.log. How to redirect this log to a custom file. Do I need to use log4j as a osgi bundle? what will be the log4j.xml configuration ?

log file contains:

!SESSION 2011-09-26 11:34:38.232 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_26
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments:  -configuration D:/CommonNBI/Trunck/release_structure/server/nbi/snmp/conf -console
!ENTRY org.eclipse.osgi 2 0 2011-09-26 11:34:44.029
!MESSAGE While loading class .... may not be fully initialized.
!STACK 0
org.osgi.framework.BundleException: State change in progress for bundle ..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最近可好 2024-12-13 11:16:46

Eclipse (Equinox) 使用他自己的记录器。要配置它,您可以在 config.ini 中定义记录器选项:

  • osgi.logfile
    文件名

  • eclipse.log.level
    设置将消息记录到 Eclipse 日志时使用的级别。

  • eclipse.log.backup.max
    允许的最大备份日志文件数。

  • eclipse.log.size.max
    允许日志文件增长的最大大小(以 Kb 为单位)。

Eclipse 帮助中的更多详细信息 (http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html)

也在这里: 登录 Eclipse/OSGi 插件
在这里: http://www.eclipsezone.com/eclipse/forums/t99588.html

Eclipse (Equinox) uses his own logger. To configure it you can define the logger options in config.ini:

  • osgi.logfile
    file name

  • eclipse.log.level
    sets the level used when logging messages to the eclipse log.

  • eclipse.log.backup.max
    the max number of backup log files to allow.

  • eclipse.log.size.max
    the max size in Kb that the log file is allowed to grow.

more details in Eclipse Help (http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html)

also here: Logging in Eclipse/OSGi plugins
and here: http://www.eclipsezone.com/eclipse/forums/t99588.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文