At 11:00 PM 1/13/2002, you wrote:
>Vikramjit,
>"e.printStackTrace()" returns a void.
>therefore ,
>"strb.append(exception.printStackTrace);"
>gives a compile error:
>
>"'void' type not allowed here strb.append(e.printStackTrace());"
>any other ways, anybody?
>kim.

I have a Log class.  Here is my current log(Exception e) method:

    public static void log(Exception e)
    {
       try
       {
          FileWriter file = new FileWriter(DEBUG_FILE_NAME, true);
          file.write(e.getMessage() + "\n\r");
          e.printStackTrace(new PrintWriter(file));
          file.flush();
          file.close();
       }
       catch (IOException e)
       {
          throw new RuntimeException("Can not write to " + DEBUG_FILE_NAME
+ "!!");
       }
    }

Hope this helps,

-- Jim

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to