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

Jörg 
 Bretschneider commented on LOG4J2-1192:
-----------------------------------------------

Dear Thies,

thanks for your contribution.
As my current project is based on log4j 1.2, I 
will first try openutils' DynamicSMTPAppender.
If we should migrate to log4j2, which I suggested 
but depend on several others to do it, I would also be able to test your work.

Regards

Joerg



Jörg Bretschneider


Forstwirtschaft, Mathematik, Erdbeben, Magnetsensorik u.v.a.m
email:  [email protected]
URL:    http://home.arcor.de/jbsfsax
_____________________________________________________

     T h e   C R O S S   a n d   t h e   E  M P T Y   G R A V E
                                          -
          s i g n s   o f   t h e   L O V E   a n d   V I C T O R Y
                         o f   t h e   L I V I N G   G O D.
_____________________________________________________






> 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
>              Labels: features
>         Attachments: ExtendedSmtpAppender.java, ExtendedSmtpManager.java
>
>
> 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
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to