I saw the code sent by Jim Moore which is much better way of doing than what
I was thinking.
I was thinking of some not-so-elegant way, where you could subclass
category, introduce a setSubject method in there, or override methods such
as info, debug etc to take the message and subject. So if you call these
methods, your category could go through all its appenders (getAllAppenders)
and then set the subject if any of the appenders are instanceof
SMTPAppender. However I am not sure of performance hit for checking on
instance type of all attached appenders.
Thanks,
-----Original Message-----
From: Gray Jones [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 30, 2001 10:24 AM
To: LOG4J Users Mailing List
Subject: Re: dynamic subject with smtp appender
I guess I could. What I was getting confused over was that the subject
field is declared in the log4j.properties file.
If I follow you correctly then I could subclass the smtp appender class and
then on the renderLogMessage (?) make a call to the setSubject method to
overwrite the one declared in the properties file.
Or are you saying that I wouldn't have to subclass the smtp appender. If so
where would I make the call to setSubject from?
Thanks for your help
----- Original Message -----
From: "Seemantini Godbole" <[EMAIL PROTECTED]>
To: "'LOG4J Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Wednesday, May 30, 2001 11:10 AM
Subject: RE: dynamic subject with smtp appender
> Could you use the setSubject method on smtp appender?
>
> -----Original Message-----
> From: Gray Jones [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 30, 2001 10:05 AM
> To: LOG4J Users Mailing List
> Subject: dynamic subject with smtp appender
>
>
> Hello,
>
> Does anybody know if you can somehow dynamically create the subject field
of
> an smtp log? For instance we are using an smtp appender to send emails of
> exceptions to the development group. Our exception class has an id and
> description field which would be nice to include in the subject field of
the
> email message so we can sort, etc.
>
> Thanks,
>
> Gray Jones
>
>
> ---------------------------------------------------------------------
> 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]
---------------------------------------------------------------------
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]