我正在使用eclipse osgi jar。 如何將由osgi生成的日誌重定向到文件?配置eclipse osgi日誌
每當我啓動osgi框架,它會生成一個類似1317008078357.log的日誌。如何將此日誌重定向到custome文件。我需要使用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 ..
感謝您的答覆。但是,「osgi.logfile」參數在頁面中不存在http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options html的。看來,月蝕想要隱藏它!另外,您可以告訴我們如何給日誌文件一個合適的名稱,因爲我們可以在log4j中爲日誌文件名分配日期。我不想放一個靜態名稱。我已經在谷歌搜索「osgi.logfile」進一步的細節,但谷歌也未能找到任何東西! – Sanmoy
我在當前項目中使用osgi.logfile。我使用文件的靜態名稱:例如-Dosgi.logfile =。/ config/equinox.log –
請注意,日誌文件中的數字是時間戳日期(即曆元以來的秒數)。如果你願意,可以很容易地轉換成日期。 – AlBlue