Howdy,
try {
String a = null;
System.out.println(a.length());
} catch (Exception e) {
logger.error("Error printing string: ", e);
}
Note the comma, i.e. the error(Object, Throwable) version of the API.
All the levels (logger.info(...), logger.warn(...), etc) have a version
of their signature with a Throwable argument.
Yoav Shapira
Millennium ChemInformatics
>-----Original Message-----
>From: Andreas Bothner [ MTN - Innovation Centre ]
>[mailto:[EMAIL PROTECTED]
>Sent: Friday, August 29, 2003 9:55 AM
>To: Log4J Users List
>Subject: how do I log an exception stacktrace
>
>Hi,
>
>I apologize if this is a stupid question, but how would I log out an
>exception's stacktrace using logger.debug() ?
>
>Regards,
>Andreas Bothner
>Systems Integrator
>
>
>NOTE: This e-mail message is subject to the MTN Group disclaimer see
>http://www.mtn.co.za/email_disclaimer.asp
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
This e-mail, including any attachments, is a confidential business communication, and
may contain information that is confidential, proprietary and/or privileged. This
e-mail is intended only for the individual(s) to whom it is addressed, and may not be
saved, copied, printed, disclosed or used by anyone else. If you are not the(an)
intended recipient, please immediately delete this e-mail from your computer system
and notify the sender. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]