Use logger instead of printStackTrace()

MSAL

When a logger is present, log exceptions rather than calling printStackTrace().

org.openrewrite.java.logging.PrintStackTraceToLogError

Optional

addLoggerBoolean

Add a logger field to the class if it isn't already present.

The name of the logger to use when generating a field.

The logging framework to use.

mod run . --recipe=org.openrewrite.java.logging.PrintStackTraceToLogError

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.