Menu
  • HOME
  • TAGS

Log4J2 Factory Error when attempting to use SMTP Appender

java,email,logging,log4j2,smtpappender

This is the important line from your stacktrace: Caused by: java.lang.NoSuchMethodError: javax.mail.Session.setProtocolForAddress(Ljava/lang/String;Ljava/lang/String;)V The setProtocolForAddress method has been part of JavaMail since version 1.4, so this suggests to me that you are using an old version of that JAR. If you are, try upgrading to a later version....

Logback SMTPAppender send only one email at a particular time with all the exceptions

java,logging,logback,smtpappender

One simple solution is to log those errors to a file and have a script on your server/machine that reads the file once a day and sends an email. If you want to use an appender, it seems to me that you would need to roll your own as I...