Configure eclipse osgi log
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.02开发者_StackOverflow中文版9
!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
精彩评论