An additional thought:

Modern JVMs are pretty efficient at building closures.
Log4j2 (not the old log4j version 1) is an alternative where you can replace

  logger.debug("foo is: " + foo)

with

  logger.debug(() -> "foo is: " + foo)

This has the same avoid-constructing-strings logic as

  logger.debug("foo is: {}", foo)

but you don't need to refactor anything.

The downside is that forgetting to create the closure will make logging slow, so in the end, you'll likely fall back to the same make-sure-everything-is-mass-refactored approach as before, so the overall advantage isn't big. However, you'll get low-hanging fruits faster, at the expense of having to try out a different logging framework.

Which means I won't recommend anything, I'm just presenting more choices in the hopes that one of them matches your situation better.

Regards,
Jo
_______________________________________________
slf4j-user mailing list
slf4j-user@qos.ch
https://mailman.qos.ch/cgi-bin/mailman/listinfo/slf4j-user

Reply via email to