Inspectopedia
 
2024.3

Non-distinguishable logging calls

Info
Code Style
New
Last modified: 03 December 2024

Reports SLF4J, Log4j2 logging calls in one class, such as logger.info("message: {}", key) with similar log messages. These calls can be non-distinguishable from each other, and this introduces difficulties to understand where a certain log message is coming from.

Example (for Java):

  • Use the Minimum length of a similar sequence option to set the minimum length of similar sequences after which calls will be reported

  • Use the Do not report calls with the 'error' log level option to ignore messages with `error` log level and when there is an exception. It may be useful to hide the warnings, because call sites can still be located using stack traces

New in 2024.1