Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play Akka logger doesn't output debug messages to console

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:

akka {
  loggers = ["akka.event.slf4j.Slf4jLogger"]
  level = "DEBUG"
  logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
}

logback.xml:

<logger name="akka" level="DEBUG" />
<logger name="actors" level="DEBUG" />

usage:

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")
  }
}

I see debug messages from the app (thrown in controller, for example), but not from actors. Starting app like activator debug run

like image 835
Ivan Yurov Avatar asked Oct 19 '22 17:10

Ivan Yurov


1 Answers

In application.conf, try changing to:

akka {
    loglevel = "DEBUG"
}

You have "level" instead of "loglevel". That fixed this for me.

like image 149
Lars Westergren Avatar answered Oct 29 '22 13:10

Lars Westergren