title: Sending logs to email using Spring boot
body: <p>I'm trying to figure out how to configure my Spring boot project, to send log messages to an email, but had no success yet. No email sent, no visible error.</p>
  
  <p>My logback.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
      &lt;include resource="org/springframework/boot/logging/logback/base.xml"/&gt;
  
      &lt;appender name="mail" class="ch.qos.logback.classic.net.SMTPAppender"&gt;
          &lt;smtpHost&gt;email-smtp.eu-west-1.amazonaws.com&lt;/smtpHost&gt;
          &lt;from&gt;dev@example.com&lt;/from&gt;
          &lt;to&gt;dev@example.com&lt;/to&gt;
          &lt;subject&gt;Something went wrong&lt;/subject&gt;
          &lt;layout class="ch.qos.logback.classic.html.HTMLLayout"/&gt;
  
          &lt;filter class="ch.qos.logback.classic.filter.ThresholdFilter"&gt;
              &lt;level&gt;DEBUG&lt;/level&gt;
          &lt;/filter&gt;
      &lt;/appender&gt;
  
      &lt;root level="INFO"&gt;
          &lt;appender-ref ref="mail"/&gt;
      &lt;/root&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>My application.yaml:</p>
  
  <pre><code>spring:
    mail:
      host: email-smtp.eu-west-1.amazonaws.com
      protocol: smtps
      username: ***
      password: ***
      port: 465
      properties:
        mail:
          smtp:
            auth: true
            socketFactory:
              port: 465
              class: javax.net.ssl.SSLSocketFactory
              fallback: false
            ssl.enable: true
          transport.protocol: smtps
  </code></pre>
  
  <p>What am I doing wrong? Is there a different way to send log messages to email in Spring Boot?</p>