From comments in SMPTAppender.java (CVS head):

"The Subject option takes a string value which will be the subject of the e-mail message. This value can be string literal or a conversion pattern in the same format as expected by org.apache.log4j.PatternLayout." "The conversion pattern is applied on the the triggering event to dynamically
compute the subject of the outgoing email message.  For example, setting
the Subject option to '%properties{host} - %m' will set the subject
of the outgoing message to the 'host' property of the triggering event followed
by the message of the triggering event."



Esher, Marc (4-7260) wrote:

I knew someone was going to say that :)

I was hoping that since this must be a pretty common thing that the
functionality would be built in. guess not.

-----Original Message-----
From: James Stauffer [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 22, 2005 9:17 AM
To: Log4J Users List
Subject: Re: changing error email subjects on the fly

You could try extending SMTPAppender.

On 6/21/05, Esher, Marc (4-7260) <[EMAIL PROTECTED]> wrote:
All,
 I'm using log.error() pretty extensively, but it's problematic to
have
all the emails have a static subject line. Is there any way to change
the subject of the email on the fly, and if no subject is set have it
default to the one in the properties file?

Thanks.

Marc


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to