Exception Management

Tracking and summarizing application exceptions

Admin4J tracks all logged exceptions and combines and summarizes all 'like' exceptions. Currently, exceptions logged with Log4J and JDK Logging are tracked. Additional loggers will be added as user demand dictates.

Display Features

Exceptions sorted from the most frequent occurring to the least.

Exceptions are persisted and survive a container recycle.

Administrators can delete exceptions that they deem dated and no longer occurring.

The length of time covered by exception statistics is configurable (defaults to 72 hours).

Screen Shots

Admin4J Exception Summary Screen shot

Installing Exception Tracking and Display

Note
If you followed the installation procedure detailed in the Getting Started section, there is no need to install the Exception tracking tool separately. Only follow this procedure if you're not using the Admin4J Home Page Servlet.

Add the following servlet and servlet mapping to your applications web.xml:

<servlet>
		<servlet-name>Exception Display Servlet</servlet-name>
		<servlet-class>net.admin4j.ui.servlets.ExceptionDisplayServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
		<servlet-name>Exception Display Servlet</servlet-name>
		<url-pattern>/admin4j/error</url-pattern>
</servlet-mapping>
									

Exception tracking is automatically installed when the display servlet is defined. The following configuration parameters are supported on the Exception Display servlet:

Parameter Required Default Description
tracking.time.in.days N 30 days Amount of time an occurance of an exception will be included in the exception statistics.
exempted.exception.types N none. Comma delimited list of exception class names that will *not* be tracked.
Note
Note that you might want to define a security constraint on the mapping to this servlet if you only want to provide display access to administrators and support personnel.
Tip
For most applications, you can excempt java.net.SocketException. For most Java EE applications, these are caused by users closing the browser before a response is complete. This is usually not something support developers need to worry about.

Exception tracking in containers servicing multiple applications.

Exception tracking works by adding itself as a log appender. If the logging product is provided by the system or common classload (used by all applications), there's a strong probability that one Exception Tracking display will capture exceptions from all applications in the container. In this case, you might prefer to have only one instance of the Exception Tracking servlet defined in this situation.

Receiving notifications for errors received from Http requests

Admin4J optionally provides notifications for Http request errors.

Installing Http Request Error Notification

Add the following filter and filter mapping to your applications web.xml:

<filter>
	<filter-name>Error Notification Filter</filter-name>
	<filter-class>
		net.admin4j.ui.filters.ErrorNotificationFilter
	</filter-class>
</filter>

<filter-mapping>
	<filter-name>Error Notification Filter</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>
														

The following configuration parameters are supported for the error notification filter.

Parameter Required Default Description
notification.time.interval.millis N none. If specified, notification will be provided for 'like' errors once per specified time period.
exempted.exception.types N none. Comma delimited list of exception class names for which notification will *not* occur.
notifier N Defaults to default.notifier.class value in the Admin4J configuration. Handles admin notification. See documentation for the Notifier you're using for any additional configuration requirements. See Admin4J Notifiers section for more detail.

Logging errors received from Http requests

Admin4J optionally provides logging for Http request errors.

Installing Http Request Error Logging

Add the following filter and filter mapping to your applications web.xml:

<filter>
	<filter-name>Error Logging Filter</filter-name>
	<filter-class>
		net.admin4j.ui.filters.ErrorLoggingFilter
	</filter-class>
	<init-param>
		<description>Specifies logger name.</description>
		<param-name>logger</param-name>
		<param-value>admin4j.webapp</param-value>
	</init-param>
</filter>
										

The following configuration parameters are supported for the error logging filter.

Parameter Required Default Description
logger N net.admin4j.ui.filters.ErrorLoggingFilter Specifies the logger name used.

Installing Http Request History Tracking

Add the following filter and filter mapping to your applications web.xml:

<filter>
	<filter-name>Request Tracking Filter</filter-name>
	<filter-class>
		net.admin4j.ui.filters.RequestTrackingFilter
	</filter-class>
	<init-param>
		<description>Specifies the number of requests tracked.</description>
		<param-name>nbr.requests.tracked</param-name>
		<param-value>10</param-value>
	</init-param>
</filter>
										

The following configuration parameters are supported for the request tracking filter.

Parameter Required Default Description
nbr.requests.tracked N 5 Specifies the number of requests tracked.