All warn, debug, warn, error etc. methods on category/logger can take a
second argument of type throwable. If this is non-null a printstacktrace
will inserted into your logfile

----- Original Message -----
From: "Dharanendra S. Pandit" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 29, 2002 8:13 AM
Subject: Doubt


> Hi *.*,
>
> I'm quite new to log4j.  I'm facing with a problem.  I hope someone
> within the forum might have a solution for this.  The problem is:
>
> When an runtime exception is raised I need to log it into a file, which
> I have already configured.  The logging should be something equivalent
> to e.printStackTrace( ), where e is of type java.lang.Exception.  If  I
> pass object e, to org.apache.log4j.Category.fatal( e ), it looks like it
> is logging e.toString( ), which I do not want.
>
> Is there a way where I could log something equivalent to what
> e.printStackTrace( ) does, into my log file?   Any better ideas of how
> to log Runtime Exceptions would be highly appreciated.
>
> Thanks in advance.
>
>
> Pandit.
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>


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

Reply via email to