I currently have the Logback SMTPAppender
working with the following <appender>
declaration inside my logback.xml
configuration file:
<appender name="logManager-smtpAppender" class="ch.qos.logback.classic.net.SMTPAppender">
<smtpHost>my-smtp-host</smtpHost>
<to>john.smith@example.com</to>
<from>no-reply@example.com</from>
<username>my_user</username>
<password>my_password</password>
<subject>%logger{20} - %m</subject>
<layout class="ch.qos.logback.classic.html.HTMLLayout"/>
<cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
<bufferSize>1</bufferSize>
</cyclicBufferTracker>
</appender>
This works fine, but I hate the fact that it forces me to specify username/password as plaintext. Ideally, I'd like to be able to read username and password from a keystore/realm/DB instead of hardcoding it into the XML file. Any remedies available? Or any other ideas? Thanks in advance!