2

In the log4j2 offcial documentation there is a code snippet for the smtp appender .My Question here is there is no smtpPassword field included. Is it going to work? if yes then where exactly we are specifying the password.

    <Appenders>
        <SMTP name="Mail" subject="Error Log" to="errors@logging.apache.org" from="test@logging.apache.org"
      smtpHost="localhost" smtpPort="25" bufferSize="50">
       </SMTP>

dks551
  • 1,113
  • 1
  • 15
  • 39
  • http://stackoverflow.com/questions/21115307/log4j2-smtp-appender-how-to-include-previous-messages-with-another-level Check this link, it might be useful. – Adds Jan 16 '17 at 13:37

1 Answers1

1
<Appenders>
<SMTP name="Mailer" suppressExceptions="false"
      subject="${subject}" to="${receipients}" from="${from}"
      smtpHost="${smtpHost}" smtpPort="${smtpPort}"
      smtpProtocol="${smtpProtocol}" smtpUsername="${smtpUser}"
      smtpPassword="${smtpPassword}" smtpDebug="false" bufferSize="20">
    <PatternLayout>
        <pattern>%d{dd-MM-yyyy HH:mm:ss,SSS} %5p %m%n</pattern>
    </PatternLayout>
</SMTP>

I think this is what you would be looking for

Adds
  • 601
  • 2
  • 12
  • 24