6

I have developed a financial data distribution server with Akka, and I want to set logging level for the application. The documentation at akka.io is sketchy at the best; they say there is no more "logging" in Akka and logging is defined through event handlers now. There is also an example of event handler configuration, including logging level:

akka {
  event-handlers = ["akka.event.EventHandler$DefaultListener"]
  event-handler-level = "INFO"
}

I did that, but though akka.conf is successfully loaded, logging still appears to be at "DEBUG" level. What can be the problem there?

1 Answer 1

5

It appears that Akka uses slf4j/logback logging with default configuration. So the (never documented) solution would be to put e.g. the following logback.xml in your classpath:

<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="false" debug="false">
  <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <pattern>[%4p] [%d{ISO8601}] [%t] %c{1}: %m%n</pattern>
    </encoder>
  </appender>
  <!-- you can also drop it completely -->
  <logger name="se.scalablesolutions" level="DEBUG"/> 
  <root level="INFO">
    <appender-ref ref="stdout"/>
  </root>
</configuration>
4
  • 1
    OK, I finally got the point. The documentation on akka.io is updated to match version 1.1, which is not released yet (cool, eh?) The documentation for 1.0 is available at akka.io/docs/akka-1.0. Mar 31, 2011 at 13:09
  • Except for that link is not available from main site, and all documentation there refers to 1.1. Apr 4, 2011 at 8:42
  • It's very accessible from the main site, there's a big text, on the front page of the docs, that says: "1.0 documentation: This documentation covers the latest release ready code in 'master' branch in the repository. If you want the documentation for the 1.0 release you can find it here." Where "here" is a link to the 1.0 documentation. Apr 4, 2011 at 9:00
  • I'm using Akka 2.3.11 and have the same problem... log level is always DEBUG. This fixed it. Editing of conf file had no effect.
    – User
    Jun 19, 2015 at 18:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.