Set logging level in Akka

I developed a financial data distribution server with Akka, and I want to set the logging level for the application. The documentation on akka.io is sketchy at best; they say that Akka no longer has β€œregistration”, and registration is now determined by event handlers. There is also an example event handler configuration, including the logging level:

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

I did this, but although akka.conf has successfully loaded, the registration is still at the "DEBUG" level. What is the problem?

+6
scala logging akka
source share
1 answer

It looks like Akka is using the default slf4j / logback entry. Thus, a solution (never documented) could be introduced, for example, the following logback.xml in your class path:

 <?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> 
+5
source share

All Articles