Supplement Error Detection

For Java and .NET, you can supplement the methods that Splunk AppDynamics considers error methods from common error handling frameworks with your own, custom-defined error methods by defining a custom logger. When the application invokes the method in a business transaction, Splunk AppDynamics considers the transaction to be an error transaction for metric purposes.

In the custom logger configuration, you can specify the parameter that contains the exception or error information passed to the method. This information will appear as the error message in Splunk AppDynamics, which invokes toString()

To configure a custom logger:

  1. In the Controller UI, on the Error Detection configuration tab, clickAdd Custom Logger Definitionin the error configuration panel.
  2. Enter a descriptive name for the custom logger definition and use the settings to identify the class name and method for the custom logger. For more information on how to use the Splunk AppDynamics UI to identify classes and methods, see Data Collectors.
  3. For theMethod Parameterfield, add a parameter definition for each parameter in the signature of the method.If the method is overloaded, create a logger definition for each form of the overloaded method where you want to detect errors. Your custom method must accept at least one parameter, which should be the parameter that conveys the logged error or exception information.
  4. For theException Parameterfield, identify the parameter in the method signature that contains the exception object by index number (0-based). This parameter, identified by an index, can be any type of object, including Arrays. If the object is not null, Splunk AppDynamics converts the object to a string, the result of which constitutes the error details. A business transaction is considered to be an error only if a non-null exception object is passed to the logger method.

Consider the following custom logger class and methods in a .NET application:

Notice that the Error method is overloaded. To capture errors logged in the second form of the method using the first parameter as the error to log. This screenshot illustrates the configuration:

Notice that the exception parameter is set to 0, identifying the string message

For Java, you can select an existing detect/ignore configuration to enable the

Consider the following custom logger class and methods in a .NET application:Notice that the Error method is overloaded. To capture errors logged in the second form of the method using the first parameter as the error to log. This screenshot illustrates the configuration:Notice that the exception parameter is set to 0, identifying the string message. For Java and .NET, you can select an existing detect/ignore configuration to enable the

  • Namespace and class = Logging.MyLogger
  • logger.Error(string message, int param1)
  • logger.Error(string message, int param1, int param2)
Configure Business Transactionoption. You can use this option to associate the following events with a specific business transaction.
  • Custom Logger
  • Ignore exception, message, and logger
  • HTTP return code and redirect page
Note: Only the selected configuration is applied to the business transaction. All the other application-level configurations are not applied to the business transaction.