Originally posted by Paul Clapham:
You mean the SMTPAppender that comes as part of log4j, or something else? If that's what you mean then the answer is you are correct. You didn't find a method to send attachments, and therefore there is no way to send attachments.
I can't imagine what you would send in these attachments, since all you've got is a log entry, but you could certainly write a subclass of SMTPAppender that did have such a method.
Originally posted by Ulf Dittmer:
I'm curious - like Paul I have problems imagining what might go into those attachments. Could you describe to us the use case you're trying to cover?
The default constructor will instantiate the appender with a TriggeringEventEvaluator that will trigger on events with level ERROR or higher.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
But SMPTAppender only logs and sends events of level error and higher. however i'm also interested to get other logs (debug,warn ,info) b/c these infos will help me track the issue in my app .
Originally posted by John Norris:
The default behavior of log4j will handle this. The parm <param name="BufferSize" value="1" /> is what you want to set. The value is the number of messages that will be buffered until an ERROR or FATAL message is received.
If you have BufferSize set to 10 and you get 20 messages of info, debug or warn before the error occurs then the last 10(including the error message) will be included in the email.
HTH
Weeds: because mother nature refuses to be your personal bitch. But this tiny ad is willing:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|