simple-java-mail icon indicating copy to clipboard operation
simple-java-mail copied to clipboard

Add option to configure smtp debug printer

Open michal-krajewski opened this issue 8 months ago • 0 comments

Hello! The default behaviour of Jakarta Mail is to push smtp debug logs to std out. It's not a viable solution for my use case; I need to redirect these logs to the Slf4j logger. To achieve that, I'm accessing Session object directly and setting a custom printer: mailer.getSession().setDebugOut(new Slf4jPrinter(logger)); (the printer is my custom implementation)

Enhancement: Allow configuring the debug printer directly in the configuration .withDebugPrinter(printer)

michal-krajewski avatar Mar 12 '25 16:03 michal-krajewski