Akka SLF4J logback configuration and usage

前端 未结 4 1695
-上瘾入骨i
-上瘾入骨i 2020-12-08 01:08

I have done the following steps to try and configure logging for my akka application:

  • created an application.conf file and placed it in src/main/resources.

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-08 01:52

    try using this application.conf:

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

    I also have noticed that you probably have wrong class name in you logback config for file appender. You have but it should be .

    Another issue may be the path to file. Try using absolute file path instead of relative. /absolute/path/testFile.log

    You can also try to change logback version to 1.2.3. Here are akka docs on configuring sl4j: link

提交回复
热议问题