配置eclipse osgi日志
我正在使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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