You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/09/03 20:02:00 UTC

[jira] [Work logged] (LOG4J2-1192) Dynamic Subject for SMTP Appender

     [ https://issues.apache.org/jira/browse/LOG4J2-1192?focusedWorklogId=305836&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-305836 ]

ASF GitHub Bot logged work on LOG4J2-1192:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Sep/19 20:01
            Start Date: 03/Sep/19 20:01
    Worklog Time Spent: 10m 
      Work Description: willdieh commented on pull request #308: LOG4J2-1192 (support dynamic Subject)
URL: https://github.com/apache/logging-log4j2/pull/308
 
 
   Edit sendMultipartMessage() to accept dynamic email Subject per comments made in ticket LOG4J2-1192 by Harry Bawls
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 305836)
    Remaining Estimate: 0h
            Time Spent: 10m

> Dynamic Subject for SMTP Appender
> ---------------------------------
>
>                 Key: LOG4J2-1192
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1192
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: Appenders
>    Affects Versions: 2.4.1
>         Environment: ALL
>            Reporter: Jörg Bretschneider
>            Assignee: Gary Gregory
>            Priority: Major
>              Labels: features
>             Fix For: 2.6
>
>         Attachments: ExtendedSmtpAppender.java, ExtendedSmtpManager.java, MaxLengthConverter.java
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> It is annoying to have log messages sent to users via SMTP Appender with a static subject, requiring recipients to open each of possibly a vast amount of log emails in order to find out what went wrong.
> Users should be able to insert runtime diagnostic context information to the message text AND to the message subject as well. 
> While the first seems to be working with Patternlayout using the mechanism with the %X{<key>} pattern based on a NDC or MDC <key> in the "ConversionPattern" parameter, it does NOT work with the "Subject" parameter with log4j (neither 1.2 nor 2.x), though some bloggers suggest it, e.g. http://stackoverflow.com/a/7015453. 
> See http://stackoverflow.com/questions/29435825/log4j2-custom-email-subject-from-map as an example where others found this also.
> This issue should have been fixed long ago.
> I suggest to extend SMTP appender in order to be able to use %X and other Pattern conversion in the "Subject" parameter properly. 
> http://openutils.sourceforge.net/openutils-log4j/smtpappender.html 
> has already done the part for applying PatternLayout to the SMTP Appender "Subject". I didn't test if this works properly. 
> Maybe this work can be included into log4j with minimal effort?
> This feature has originally been realized in LOGBACK using an MDC in Patternlayouts: http://logback.qos.ch/manual/mdc.html



--
This message was sent by Atlassian Jira
(v8.3.2#803003)