Skip to end of metadata
Go to start of metadata
Table of Contents

The following configuration provides for database-backed auditing and statistics for CAS using the Inspektr Java library. The configuration assumes there exists a bean named "dataSource" that implements javax.sql.DataSource defined somewhere in the Spring application context, e.g. deployerConfigContext.xml:

deployerConfigContext.xml
Icon

The configuration below is the suggested configuration up until CAS 3.4. In CAS 3.4, the configuration changed. See the configuration further below.

The following configuration is based on the auditTrailContext.xml file in WEB-INF/unused-spring-configuration/auditTrailContext.xml in the CAS 3.3.1 distribution WAR archive. The following configuration must be placed in an XML file in WEB-INF/spring-configuration of the WAR file deployed in your environment; a Maven WAR Overlay is a convenient way to do this in a repeatable fashion.

auditTrailContext.xml
Icon

This is the configuration for CAS 3.4

Icon
As of at least CAS 3.4.10, this is included already in the distribution as WEB-INF/spring-configuration/auditTrailContext.xml

Inspektr assumes the database pointed to by the JDBC data source contains tables with the schema described at http://code.google.com/p/inspektr/wiki/DatabaseTables. The following script will create these tables with reasonable indices in Oracle; modify as needed for your database platform.

Oracle Create Table Script

Automatic Cleaning

If you're using the JdbcAuditTrailManager, you might want to automatically clean the audit log.  Here's some example code (for your auditTrailContext.xml) that cleans out entries older than 180 days.  This has been tested in CAS 3.4.10.

Snippet from auditTrailContext.xml - Automatic Audit Cleaning
  • No labels