I have a simple application and on some value changes a workflow is triggered. The workflow sends emails with
My code looks like:
Mail m = new Mail("server", "587", "user", "password"); m.setTLSEnabled(true); m.setContentType(Mail.CONTENT_HTML); m.send("firstname.lastname@example.org", "email@example.com", "Subject", "Message");
Some users told me that they didn’t receive an email. I want to find out if the problem is in my application. So, how is it possible to log mail transport?
I know that it’s possible to add my own log output before
m.send(...) but this doesn’t log the mail transport.
Mail transport logging is not related to JVx because it just uses Java Mail API. To enable logging, just configure the log level of:
com.sun.mail.level = ALL
This log level logs all mail transports. The API documentation contains logger information at the end of package summaries, e.g.
Just put your log definition in your
logging.properties and JVx will read this automatically. It’s also possible to set the log level programmatically:
But I recommend using