ClassNotFoundException for Akka logging
1 minutes read | 107 words by Ruben BerenguelA few months ago I stumbled into the problem of Akka logging, specifically
ClassNotFoundException when using akka.event.slf4j.Slf4jLoggingFilter
, just by
following the details of the Logging - SL4J section of Akka
documentation.
Of course, the error source is obvious in hindsight, but in the moment the fact that this was a multiproject build with several dependency paths made me miss a crucial reason for longer than I want to admit:
YOU NEED TO ADD THE SL4J IMPORT IF YOU WANT TO USE SL4J FOR LOGGING!
Add this to your dependencies (I’m assuming you have a val for akkaVersion to DRY):
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion