如何在log4j.properties文件中配置过滤器

时间:2019-12-17 20:24:05

标签: spring log4j

如何仅生成错误级别的电子邮件?当前,电子邮件附加程序正在为所有日志记录事件生成消息。

appender.email = org.apache.log4j.net.SMTPAppender
appender.email.type = smtp
appender.email.name = Email
appender.email.smtpHost = smtp.google.com
appender.email.from = xxxx@gmail.com
appender.email.to = xxxx@gmail.com
appender.email.cc = xxxx@gmail.com
appender.email.subject = Error in application
appender.email.layout.type = HTMLLayout
appender.email.Threshold = ERROR

logger.foo.appenderRefs = smtp
logger.foo.level = info
logger.foo.additivity = false
logger.foo.appenderRef.smtp.ref = Email

0 个答案:

没有答案