Doesn't the Layout used have something to do with whether or not the
stack trace information is inserted into your logging file?  So, if you use
FileAppender and choose a layout of SimpleLayout, TTCCLayout, or
PatternLayout, then you wouldn't see any stack trace in your file.  But, if
you choose XMLLayout then you would see the stack trace information.  This
would have to do with the Layout.ignoresThrowable().

        I wanted to use the FileAppender and see stack trace information,
but I didn't want the layout determined by XMLLayout.  So, I extended
PatternLayout and PatternParser to handle a new conversion character that
could be used to print stack trace information.  Is this the right thing to
do in this situation?


-----Original Message-----
From: max [mailto:max]
Sent: Friday, March 29, 2002 5:01 AM
To: Log4J Users List
Subject: Re: Doubt


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]>

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

Reply via email to