Configuring Auditing and Monitoring

The auditing and monitoring features rely on the same subsystem in JasperReports Server. The settings for configuring auditing and monitoring are both located in the WEB-INF/applicationContext-audit.xml file. The beans and properties of this file are used to enable auditing and monitoring, set the archive options, and select which events are logged.

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

audit.enabled=false

Set this property to true to enable the auditing and monitoring subsystem. Given the default value of the other settings, only auditing is turned on when this setting is first set to true.

monitoring.enabled=false

Once audit.enabled=true, set this property to true to enable monitoring. More precisely, this setting controls the logging of events in the tables used by the monitoring Domain.

audit.sizeof.enabled=false By default, the large print objects in memory are not measured because that can impact performance. If you want to temporarily enable auditing for the memory usage of print objects in reports, set this value to true.

Configuration File

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

Property

Bean

Description

isAuditPersistence
Enabled

audit
Service

Set this property to false to disable logging of events in the tables used by the audit Domain. This allows you to turn off auditing data while keeping monitoring data.

Avoid turning off both monitoring and audit persistence. Instead, turn off the entire subsystem with audit.enabled=false.

Auditing Archive Options

Archiving is a mechanism to move audit data to separate database tables. For example if you create reports for weekly or monthly server usage based on the audit Domain, you will never access audit logs older than a week or month. 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. Archiving automatically moves audit data to separate database tables after a certain time. If you want to create reports on historical audit data, Jaspersoft also provides a Domain to access the archived audit logs. 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.

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 database. The default is 30. Older data is moved to the archive.

maxAudit
EventAge

auditService

The number of days to keep the data. Older data is deleted. The default is 0 (zero), meaning that old data is never deleted.

cronExpression

auditEvent
ArchiverTrigger

Defines the frequency of the archiving job in cron syntax. The default, 0 0 5* * ?, is every day at 5a.m.

cronExpression

auditEvent
PurgerTrigger

Defines the frequency of the audit delete (purge) job in cron syntax. 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.

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 to disable 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" />

Version: 
Feedback