SMTP(Simple Mail Transfer Protocol)即简单邮件传输协议,它是一组用于由源地址到目的地址传送邮件的规则,由它来控制信件的中转方式。
http://logback.qos.ch/manual/appenders.html#SMTPAppender
<configuration> <!-- 错误日志发送邮件 --> <appender name="errorEmail" class="ch.qos.logback.classic.net.SMTPAppender"> <filter class="ch.qos.logback.classic.filter.LevelFilter"> <level>ERROR</level> <onMatch>ACCEPT</onMatch> <onMismatch>DENY</onMismatch> </filter> <smtpHost>${mail.smtp.host}</smtpHost> <smtpPort>${mail.smtp.port}</smtpPort> <username>${mail.username}</username> <password>${mail.password}</password> <from>${mail.from}</from> <to>${log.mail.to.1}</to> <to>${log.mail.to.2}</to> <subject>${CONTEXT_NAME} - ${HOSTNAME}</subject> <layout class="ch.qos.logback.classic.html.HTMLLayout"> <pattern>%date %-5level %logger{35} - %message%n</pattern> </layout> </appender> <root level="INFO"> <appender-ref ref="errorEmail" /> </root> </configuration>
http://pop-ent.21cn.com/