You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Omer van der Horst Jansen <om...@clickshare.com> on 2001/02/06 18:48:13 UTC

SMTPAppender and exceptions

Hi,

I'm using SMTPAppender to send out an e-mail whenever an error event is
logged. I'm finding that when I log an exception like this

catch (Exception e)
{
    cat.error("Oops!", e);
}

the e-mail will only have the "Oops!" line, whereas my rotating file log
will also have the stack trace. 

I'd like to have the stack trace in the e-mail as well. Is there a
simple way to do that? 

Thanks,

	Omer van der Horst Jansen

omer@clickshare.com

Re: SMTPAppender and exceptions

Posted by Ceki Gülcü <cg...@urbanet.ch>.
Omer,

This is a bug! The SMTPAppender assumes that its layout takes care of the exception, which is not the case with the PatternLayout. I suggest that you use the HTMLLayout with SMTPAppender until the bug gets fixed. Ceki

At 12:48 06.02.2001 -0500, you wrote:
>Hi,
>
>I'm using SMTPAppender to send out an e-mail whenever an error event is
>logged. I'm finding that when I log an exception like this
>
>catch (Exception e)
>{
>    cat.error("Oops!", e);
>}
>
>the e-mail will only have the "Oops!" line, whereas my rotating file log
>will also have the stack trace. 
>
>I'd like to have the stack trace in the e-mail as well. Is there a
>simple way to do that? 
>
>Thanks,
>
>        Omer van der Horst Jansen
>
>omer@clickshare.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org

----
Ceki Gülcü           e-mail: cgu@qos.ch (preferred)
av. de Rumine 5              ceki_gulcu@yahoo.com
CH-1005 Lausanne          
Switzerland            Tel: ++41 21 351 23 15