logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject Re: problem logging the whole stack of my own Exception
Date Mon, 26 Aug 2002 08:33:33 GMT

At 08:43 26.08.2002 +0200, you wrote:
>Hello,
>
>I planed to use Log4J for my applikation but I got a problem by logging the
>whole stack of my own Exception.
>
>For excample:
>I wrote an exceptionclass extending exception. The construktor expacts a
>parentexception as a parameter. And finally I overwrote the method
>printStackTrace to get both the parentexception and my own exception in one
>stacktrace.
>
>Like this:
>
>   public class WQException extends Exception
>   {
>     private Exception parent = null;
>
>     public WQException(String s, Exception parent)
>     {
>       super(s);
>       this.parent=parent;
>     }
>
>     public void printStackTrace()
>     {
>       super.printStackTrace(s);
>       if ( parent != null )
>       {
>         s.println("nested Exception is:");
>         parent.printStackTrace(s);
>       }
>     }
>   }

The above code does not compile. Please provide code that compiles so that 
we can discuss it.

--
Ceki


--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message