Simply use the overloaded version of the appropriate method that accepts
two parameters: an Object and a Throwable. Pass an error message string
to the first and your exception to the second. For example, from the
**API DOCS** (!) for the Logger class:
public void error(Object message, Throwable t)
Log a message object with the ERROR level
including the stack trace of the Throwable t
passed as parameter.
Regards,
Al.
-----Original Message-----
From: abhay [mailto:[EMAIL PROTECTED]]
Sent: 12 December 2002 10:33
To: JDJList
Subject: [jdjlist] getting stackTrace into a logger
Hi all,
I'm using jdk1.3 and apache log4j for logging errors,transactions etc.
All the methods of the apache Logger accept Object as parameter
Now if I pass an Exception object as a parameter then 'toString()' is
invoked on it and a single line exception is logged. Instead i'm
interested
in getting the whole stackTrace.
Can anyone tell me how to solve this problem
(once again ... please bear in mind that i'm using jdk1.3 since the
server
side doesn't allow me jdk1.4)
Thank you in advance.
regards
abhay
____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm
Be respectful! Clean up your posts before replying
____________________________________________________
____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm
Be respectful! Clean up your posts before replying
____________________________________________________