We are using Akka 2.4.19 with Scala 2.12.12. If I configure logback to log line numbers I only see:
Slf4jLogger.scala:83
which is a class in the akka library. How do I get the real location of the issued log statement or what am I doing wrong?
I do use the following pattern:
<pattern>%d{HH:mm:ss.SSS} %-5level [%thread] [%logger] [%F:%L] [%mdc{akkaSource:-}] %msg [%mdc]%n</pattern>
Patrik answered:
"…Short answer is that Akka’s logging is asynchronous so Slf4jLogger is expected. You can create your own slf4j Logger with the LoggerFactory and then you will see your own source code. "
I am not sure if I understand what and why to do. Logback is a backend for Slf4j. Do we have to switch to Slf4j Impl now? And why?
2 posts - 2 participants