Play Akka logger不会将调试消息输出到控制台 [英] Play Akka logger doesn't output debug messages to console
本文介绍了Play Akka logger不会将调试消息输出到控制台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用Scala 2.11.6
和Play 2.4.6
从Akka演员设置调试日志记录到控制台.所以我看到带有此配置的信息消息,但没有调试:
I'm trying to setup debug logging to console from Akka actors with Scala 2.11.6
and Play 2.4.6
. So I see info messages with this config, but not debug:
application.conf:
application.conf:
akka {
loggers = ["akka.event.slf4j.Slf4jLogger"]
level = "DEBUG"
logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
}
logback.xml:
logback.xml:
<logger name="akka" level="DEBUG" />
<logger name="actors" level="DEBUG" />
用法:
package actors
import akka.actor._
import akka.event.Logging
object DispatchActor {
def props(out: ActorRef) = Props(new DispatchActor(out))
}
class DispatchActor(out: ActorRef) extends Actor {
val log = Logging(context.system, this)
log.debug("akka started: info")
def receive = {
case msg: String =>
log.debug("actor received a message")
out ! ("I received your message: " + msg)
}
override def postStop() = {
log.info("actor closed")
}
}
我看到了来自应用程序(例如,扔在控制器中)的调试消息,但是没有来自参与者的调试消息.正在启动activator debug run
I see debug messages from the app (thrown in controller, for example), but not from actors. Starting app like activator debug run
推荐答案
在application.conf中,尝试更改为:
In application.conf, try changing to:
akka {
loglevel = "DEBUG"
}
您具有级别"而不是日志级别".这为我解决了这个问题.
You have "level" instead of "loglevel". That fixed this for me.
这篇关于Play Akka logger不会将调试消息输出到控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文