Project

Profile

Help

Logging Exceptions

Added by Anonymous over 17 years ago

Legacy ID: #3953915 Legacy Poster: sarvs (sarvs)

Hi, I want to log the exceptions to a specific file, I read about the Exception Handler and tried implementing it but for some reason all the exceptions are not being written to the file. Is there any sample code I can refer to. Thanks


Replies (1)

RE: Logging Exceptions - Added by Anonymous over 17 years ago

Legacy ID: #3954024 Legacy Poster: Michael Kay (mhkay)

I'm not sure what you mean by the "Exception Handler"; and it depends a little whether you are using XSLT or XQuery, Java or .NET. It also depends on whether you are trying to log compile time errors or run-time errors. In general the mechanism (for Java) is that you write an ErrorListener and register it with the TransformerFactory or Configuration (for compile time errors) or with the Transformer/Controller (for run-time errors). Alternatively, you can do getErrorListener() to get the system-supplied ErrorListener, cast it to a StandardErrorListener, and then call its setErrorOutput() method to change the destination where it writes its messages (this is useful if you only want to change the destination of messages and not their format).

    (1-1/1)

    Please register to reply