且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Map中的Log4j2自定义电子邮件主题

更新时间:2023-02-01 22:20:00

当前,SmtpAppender类(实际上是其助手SmtpManager)创建一次MimeMessage对象,并将其重新用于所有要发送的消息.消息主题仅初始化一次.读取您的配置后,查找仅完成一次.

Currently, the SmtpAppender class (actually its helper SmtpManager) creates a MimeMessage object once and reuses it for all messages to be sent. The message subject is initialized only once. The lookup is done only once when your configuration is read.

我建议您针对用例在Log4j2 Jira问题跟踪器上提出功能请求.

I suggest you raise a feature request on the Log4j2 Jira issue tracker for your use case.