You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2009/11/15 17:57:49 UTC

DO NOT REPLY [Bug 48200] New: Allow SMTPAppender to have replaceable parameters in Subject using MDC

https://issues.apache.org/bugzilla/show_bug.cgi?id=48200

           Summary: Allow SMTPAppender to have replaceable parameters in
                    Subject using MDC
           Product: Log4j
           Version: 1.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Other
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: rams.rapo@gmail.com


It would be helpful to be able to have parameters that
are replaced on a per-log event basis on the Subject
line for the SMTPAppender. These parameters would be set using Log4J MDC. 

I have tried configuring log4j.xml with dynamic parameters, however it didn't
work. 


<param name="Subject" value="Error from Application. Client IP -
[%X{clientIP}], Server IP - [%X{serverIP}]" /> 


Basically i'm trying to have ip address of client from where the request came
and server which encountered the error in subject line itself. I have to
manually open each mail now!

I have set client ip, server ip using MDC in servlet filter which processes all
requests coming to application.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 48200] Allow SMTPAppender to have replaceable parameters in Subject using MDC

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48200

--- Comment #1 from Sven Diedrichsen <sd...@yahoo.de> 2009-12-07 12:42:12 UTC ---
Created an attachment (id=24677)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24677)
Simple patch of the SMTPAppender to allow PatternLayout in mail subject

Simple patch of the SMTPAppender to allow PatternLayout in mail subject.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 48200] Allow SMTPAppender to have replaceable parameters in Subject using MDC

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48200

Sven Diedrichsen <sd...@yahoo.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
          Component|Other                       |Appender
         Resolution|                            |WORKSFORME
           Severity|critical                    |enhancement

--- Comment #2 from Sven Diedrichsen <sd...@yahoo.de> 2009-12-07 12:48:27 UTC ---
I have attached some simple patch of the SMTPAppender to allow the mail subject
to use some PatternLayout string. For this the first log event to be send by
mail is used.
This should better be done by allowing the subject to be configured and
layouted by some pattern but this requires some additional properties/ XML
elements for LOG4J SMTPAppender config.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 48200] Allow SMTPAppender to have replaceable parameters in Subject using MDC

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48200

Sven Diedrichsen <sd...@yahoo.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |swells@veoh.com

--- Comment #3 from Sven Diedrichsen <sd...@yahoo.de> 2009-12-07 13:16:21 UTC ---
*** Bug 46723 has been marked as a duplicate of this bug. ***

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org