2011-10-27 36 views
1

在使用Akka時,我實現了一個簡單的命令行應用程序。有沒有辦法停用Akka的調試輸出?

但阿卡也打印報表,如命令行:

[GENERIC] [27.10.11 22:57] [RemoteClientStarted([email protected],/127.0.0.1:3000)] 
[GENERIC] [27.10.11 22:57] [RemoteClientConnected([email protected],/127.0.0.1:3000)] 
[GENERIC] [27.10.11 22:57] [RemoteClientShutdown([email protected],/127.0.0.1:3000)] 
[GENERIC] [27.10.11 22:57] [RemoteClientDisconnected([email protected],/127.0.0.1:3000)] 

有沒有一種方法來禁用此調試輸出(或重定向到其他地方)?

回答

1

做了幾件事隱藏[GENERIC]日誌標籤。不知道是否需要所有這些,但它似乎工作。

增加了以下我akka.conf

event-handlers = ["akka.event.slf4j.Slf4jEventHandler"] 
event-handler-level = "WARNING" 

確保要更改的權akka.conf,你可能有一個AKKA_HOME規定或者您可能錯誤地投下了akka.conf到類路徑中。

也做了在底部的以下更改我的logback.xml

<logger name="akka" level="WARNING"/> 
<root level="WARNING"> 
<!-- <appender-ref ref="stdout"/> --> 
<appender-ref ref="R"/> 
</root> 

logback.xml應該就住在旁邊的akka.conf

2

也許文檔能有所幫助:

EventHandler

+0

我會在哪裏必須把這樣的配置文件? – soc

+1

也許這些文檔可以提供幫助:http://akka.io/docs/akka/1.2/general/configuration.html –

相關問題