裝完 JBoss EAP 6.x ,並利用 Eclipse 開發程式除錯 Debug 時,發現一般使用 System.out.println() &  logger.info() 都沒有出現在 Console 中,查了好久才找到正解如下:

1. 在 Eclipse 開發環境:

在 Servers 視窗下的 JBoss EAP Server 點兩下,選擇 Open Launch configuration ,然後在 VM arguments 裡最後加入 -Dorg.jboss.as.logging.per-deployment=false 即可,如下圖:

JBossEAP_Eclipse.png  

這樣訊息就會出來了,但 System.out.print() 仍會不出現,直到下一個 System.out.println() 才會一起出現,這是JBoss EAP 的 Bug.

 

2. 在 JBoss 正式環境的設定:

Step 1 :

修改 $JBOSS_HOME/standalone/configuration/standalone.xml 增加 <use-deployment-logging-config value="false"/> 在 <profile>...</profile> 中如下:

    <profile>
        <subsystem xmlns="urn:jboss:domain:logging:2.0">
              <use-deployment-logging-config value="false"/>
            <console-handler name="CONSOLE">
                <level name="INFO"/>
                <formatter>
                    <named-formatter name="COLOR-PATTERN"/>
                </formatter>
            </console-handler>

 

參考:

http://mariemjabloun.blogspot.tw/2013/11/disable-jboss-eap-6-logging-exclude.html

https://bugzilla.redhat.com/show_bug.cgi?id=1070453

arrow
arrow

    MIS 發表在 痞客邦 留言(1) 人氣()