Exception sensor
The Exception sensor is used to gather information about exceptions in an application. The Exception Tracer is able to trace created, thrown, and handled exceptions within a target application. The Exception Tracer gathers information about methods and constructorsthat can cause an Exception. It must be specified which classes should be instrumented. There can be as many Exception Tracer configurations defined as you like.
Configuration
To enable the Exception Tracer, the name together with the fully-qualified-name of the class to instrument must be defined. As an optional parameter it is possible to enable superclass or interface matching support. The Exception sensor name must always be defined as exception-sensorin the configuration file, so there is no need to write down the fully-qualified name of this sensor type. There is no limit in how manyexception-sensor configurations can be defined. When defining multiple exception-sensor lines, there is always only one Exception Tracer created, which has one or more configurations.
exception-sensor [Exception Class] [options]
In contrast to method sensor types where the definition will provide the name of the class/method on which the sensor is to be applied, the exception sensor needs the name of the Exception class that should be traced.
Examples
The next table provides samples of how the exception tracer can be used. Bear in mind, that you can define multiple exception-sensors.
Configuration |
Description |
---|---|
exception-sensor java.lang.Throwable superclass=true |
|
exception-sensor my.package.exception.MyException |
|
exception-sensor my.package.ex*.*Exception |
|
exception-sensor my.package.exception.IException interface=true |
|
exception-sensor my.package.exception.My*Exception |
|
exception-sensor * |
|
exception-sensor my.pack*.ex*.* superclass=true |
|