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 Ceki Gülcü <cg...@qos.ch> on 2001/03/22 09:59:31 UTC
Re: How to print my exception's stack trace to a file using
log4j
Hadi,
Try:
try {
..
} catch(Exception e) {
cat.error("some message", e);
}
Regards, Ceki
At 09:47 22.03.2001 +0100, you wrote:
>instead of this code that prints the stack trace to the console
>try{
> ...
> ...
>}catch(Exception e){
> cat.error(e.getMessage());
> e.printStackTrace();
>}
>
>I would like to keep the stack trace in an appender (a file) that I have
>defined in log4j.properties
>How is it possible?
>
>Hadi
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org
I hope to see you at my ApacheCon 2001 presentation
entitled "Log4j, A Logging Package for Java".
See http://ApacheCon.Com/2001/US/ for more details.
----
Ceki Gülcü Web: http://qos.ch
av. de Rumine 5 email: cgu@qos.ch (preferred)
CH-1005 Lausanne ceki_gulcu@yahoo.com
Switzerland Tel: ++41 21 351 23 15
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org