micrometer-metrics / micrometer

An application observability facade for the most popular observability tools. Think SLF4J, but for observability.
https://micrometer.io
Apache License 2.0
4.39k stars 966 forks source link

Log warning message with WARN level in logWarningAboutLateFilter() when DEBUG level is enabled #5231

Open izeye opened 1 week ago

izeye commented 1 week ago

Lowering log level for the warning message when DEBUG level is enabled seems to be inconsistent.

See gh-4917

shakuzen commented 6 days ago

Having everything in one log message was intentional so there was no chance of the context being split across log messages that possibly have other log messages in between them when viewing the logs. I can see your point about there being no warn log in the case of debug logging being enabled, but I think I imagined most users will not have debug enabled initially until they see the warning and then they will enable debug logging. In that sense, they will have likely seen the warn level log already and be looking for the stacktrace in the debug level log. That's not guaranteed, though. I suppose it's a tradeoff one way or the other. Does that make sense? Am I missing anything? @jonatan-ivanov thoughts?

izeye commented 6 days ago

@shakuzen Thanks for the feedback!

Is it okay if the split messages were merged into one as before but with WARN level?

izeye commented 6 days ago

Is it okay if the split messages were merged into one as before but with WARN level?

Spring Framework seems to have a similar handling as follows: https://github.com/spring-projects/spring-framework/blob/0ea7af746521118f9f562ed3ea7da5c6966a99bd/spring-beans/src/main/java/org/springframework/beans/factory/annotation/InitDestroyAnnotationBeanPostProcessor.java#L243-L248