-
Notifications
You must be signed in to change notification settings - Fork 75
[Kaizen] improve logging configuration #977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please follow up on Petra's comment.
So I did some basic performance checks with the |
4a003f5
to
ccbf7fd
Compare
I added a change to filter out the many messages like:
|
… Logback. disable java.util.logging (used by legacy code in JUPnP)
ccbf7fd
to
b6b157d
Compare
src/main/resources/conf/base.conf
Outdated
# Not using ${logging.logs-level} because it might be set to TRACE, which our version of Akka doesn't have. | ||
loglevel = "INFO" | ||
# the effective log level is configured for Logback; this loglevel only determines what is passed to Slf4j | ||
loglevel = "DEBUG" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok so I think this is overthinking it. the consequence of passing TRACE
to the log system is:
[ERROR] [05/13/2021 09:51:24.512] [run-main-0] [EventStream(akka://mantis_system)] unknown akka.loglevel TRACE
akka.event.Logging$LoggerException:
at akka.event.LoggingBus.$anonfun$startDefaultLoggers$1(Logging.scala:113)
at akka.event.LoggingBus.$anonfun$startDefaultLoggers$1$adapted(Logging.scala:110)
at scala.Option.getOrElse(Option.scala:201)
at akka.event.LoggingBus.startDefaultLoggers(Logging.scala:110)
at akka.event.LoggingBus.startDefaultLoggers$(Logging.scala:108)
at akka.event.EventStream.startDefaultLoggers(EventStream.scala:26)
at akka.actor.LocalActorRefProvider.init(ActorRefProvider.scala:605)
at akka.actor.ActorSystemImpl.liftedTree2$1(ActorSystem.scala:1021)
at akka.actor.ActorSystemImpl._start$lzycompute(ActorSystem.scala:1017)
at akka.actor.ActorSystemImpl._start(ActorSystem.scala:1017)
at akka.actor.ActorSystemImpl.start(ActorSystem.scala:1040)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:272)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:316)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:260)
I think this is fine and it's a better solution to use ${logging.logs-level} instead of trying to guess what a good level might be.
maybe a note on the logs-level
setting that notes this interaction.
eg.
# Note: if this level is set to TRACE the akka.loglevel needs to be adjusted (akka does not know TRACE)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, that won't work as expected when overall "logs-level" is info but you configure some specific parts for a level lower than that. (Which is what I'm doing a lot now.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me this feels like a bit of personal preference. How often do we use a log level of trace anyway? For that I think I prefer Dom's perspective
5852359
to
3cdbf51
Compare
Writing a top-level comment to clarify the reason for this PR: it's a bit hidden (and surprising, at least to me) that you have to change the |
akka.loglevel
should be set toDEBUG
so that messages with this level can actually show up in the logs, if we configure them appropriately. The filters and levels defined inlogback.xml
are applied after and thus will still filter all debug messages by default.This should not cause significant overhead: https://doc.akka.io/docs/akka/current/logging.html#slf4j