Configuring Auditing and Monitoring

The auditing and monitoring features both rely on the same subsystem in JasperReports Server. The settings are located in the .../WEB-INF/applicationContext-audit.xml file, but their values are set in the .../WEB-INF/js.config.properties file. The beans and properties of these files are used to enable auditing and monitoring, set the archive options, and select the events to be logged.

You must enable CLOB fields on your JasperReports Server before enabling audits if you want to use audit Domains for your data. See Enabling CLOB Fields for instructions on enabling CLOB fields.

Enabling Auditing and Monitoring

Because auditing and monitoring share the same subsystem, there is a master configuration setting to turn on the subsystem, and individual settings for auditing and monitoring. This allows you to turn on each feature independently, or turn off the whole subsystem to avoid any overhead from an unused feature.

By default, the auditing and monitoring subsystem is off.

Enabling Auditing and Monitoring Options

Configuration File

.../WEB-INF/js.config.properties

Property

Description

feature.audit_monitoring.enabled

Set this property to true to enable the auditing and monitoring subsystem. You must also turn on audit and/or monitoring records independently with the following two properties. If you do not need auditing or monitoring, set this property to false to avoid any performance overhead.

audit.records.enabled

Once feature.audit_monitoring.enabled=true, set this property to true to enable auditing. This setting controls the logging of events in the tables used by the audit reports.

monitoring.records.enabled

Once feature.audit_monitoring.enabled=true, set this property to true to enable monitoring. This setting controls the logging of events in the tables used by the monitoring Domain.

Auditing Archive Options

Archiving automatically moves audit data to separate database tables, called the audit archive, after a certain time. For example if you create reports for weekly server usage based on the audit Domain, you'll never see audit data older than a month by default. Because audit data can be quite large, the old data can increase the time needed to write new data and query data for your report. If you want to create reports on audit archive tables, there is a separate Domain to access the archived audit data. You can also configure the audit feature to delete old archive data if you no longer need it.

You should set the archiving interval to a level that balances your need to record and access audit data with your server's performance on large audit tables. Use the following configuration settings to change the archiving behavior.

Archiving and deleting (or purging) of audit data happens once per day, by default in the early morning hours. You can also set the time and frequency of these operations.

Auditing Archive Options

Configuration File

.../WEB-INF/applicationContext-audit.xml

Property

Bean

Description

maxAudit
EventAge
ToArchive

auditService

The number of days to keep audit data in the active audit tables. The default is 30. Older data is moved to the archive.

maxAudit
EventAge

auditService

The total number of days to keep any audit data. Older data is deleted from either the active or the archive tables. If this value is non-zero but less than the maxAuditEventAgeToArchive, the audit data will be deleted before it is ever archived (this may be useful if you don't want to use the archive). The default is 0 (zero), meaning that old data is never deleted.

cronExpression

auditEvent
ArchiverTrigger

Defines the frequency of the archiving job as a cron expression. The default 0 0 5* * ? is every day at 5 A.M.

cronExpression

auditEvent
PurgerTrigger

Defines the frequency of the audit delete (purge) job as a cron expression. The default 0 0 3 * * ? is every day at 3 A.M.

The cronExpression properties use a Quartz scheduler cron expression that specifies the repeating trigger as seconds, minutes, hour, day of month, month, day of week, respectively.

Disabling Events and Properties

By default, all events and properties are logged. To enable or disable logging of a given event or property, use the applicationContext-audit.xml configuration file. Events that are logged are used by both the audit and monitoring subsystems, therefore disabling an event makes it unavailable for both auditing and monitoring.

In the file, event types and their properties are listed under <util:map id="enabledEventsMapping">. The map has three parts:

WEB_SERVICES – Event types related to accessing JasperReports Server through a web service.
GUI – Event types for access through the user interface.
INTERNAL – Event types used by the server itself, such as when running a scheduled report.

To disable an event, comment it out. For example:

<!-- <entry key="createFolder" value="folderName,folderLabel,folderDescription" /> -->

To disable a property, use any of these measures:

Delete the property. For example, remove folderDescription, resulting in:

<entry key="createFolder" value="folderName,folderLabel,exception" />

Disable it with the | syntax. For example:

<entry key="createFolder" value="folderName,folderLabel,|folderDescription,exception" />

Use the "all except" *| syntax to specify only the disabled property. All others are recorded. For example:

<entry key="createFolder" value="*|folderDescription" />