配置eclipse osgi日志 [英] Configure eclipse osgi log

查看:337
本文介绍了配置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常量:OS = win32,ARCH = x86,WS = win32,NL = en_US
命令行参数:-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加载类....可能没有被完全初始化。
!STACK 0
org.osgi.framework.BundleException:bundle的进度状态更改


解决方案

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


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 custome 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 ..

解决方案

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

这篇关于配置eclipse osgi日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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