This content has been marked as final.
Show 3 replies
-
1. Re: Sending Mail on Errors with Log4j
khoyaraaz Apr 6, 2006 4:15 PM (in response to khoyaraaz)So the solution (or what I was missing) was to include the SMTP appender to the root category in the lo4j.xml file (at the bottom of the file):
<!-- ======================= --> <!-- Setup the Root category --> <!-- ======================= --> <root> <appender-ref ref="CONSOLE"/> <appender-ref ref="FILE"/> <appender-ref ref="SMTP"/> </root>
Works now :) . That was easy, just took forever to figure it out by myself, wish these things were documented somewhere.
I am receiving 2 emails though, one for each error. Anyone know how I could get a bunch of errors in the same mail, grouped by time or session?
Thanks in advance :) -
2. Re: Sending Mail on Errors with Log4j
jiwils Apr 6, 2006 6:02 PM (in response to khoyaraaz)"khoyaraaz" wrote:
I am receiving 2 emails though, one for each error. Anyone know how I could get a bunch of errors in the same mail, grouped by time or session?
The Log4j SMTPAppender provides much of that functionality by default.
Take a look at http://logging.apache.org/log4j/docs/api/org/apache/log4j/net/SMTPAppender.html for more information. -
3. Re: Sending Mail on Errors with Log4j
jiwils Apr 6, 2006 6:04 PM (in response to khoyaraaz)"jiwils" wrote:
"khoyaraaz" wrote:
Take a look at http://logging.apache.org/log4j/docs/api/org/apache/log4j/net/SMTPAppender.html for more information.
The http://logging.apache.org/log4j/docs/api/org/apache/log4j/spi/TriggeringEventEvaluator.html class has more helpful input too.