Configure a logger for auditsΒΆ

Premise

This tutorial illustrates the main steps to configure an event logger to perform audits for changes of attribute values of nodes of interest. Then records the occurrences of the AuditWriteUpdateEventType event generated inside the Model node.

The data collected on the event are the following:

  • Event source, i.e. the project node on which the events are listened to.

  • ID information of the user who generated the event.

  • Event date and time.

  • Change data of the attribute value (before/after the edit).

Download the example project from here. In this example, in addition to the AttributeChangeLogger logger subject of the tutorial, there are several loggers that each record only one audit event. For an example of a logger that records several audit Types of Events, download the example project from here.

Steps

  1. Add an Event logger.

  2. Configure the event source and event type to listen to.

  3. Select the event properties of interest.

  4. Configure a custom property for the event.

Add an Event logger

  1. In Project, right-click Loggers, then select New, then click Event logger: EventLogger1 appears in the example project renamed AttributeChangeLogger.

  2. In the Database property, select the database in which to store the selected properties: a table for each event type is automatically created and configured in the database; and in each table, a column for each property to be stored.

Configure the event source and event type to listen to

  1. Click image1 next to Event configuration: the set of properties for the event configuration appears.

  2. Next to Event source, click image2 and select the project node of interest. In the example, the event source is the Model node.

  3. Set the Subtree listen property to True: the logger also records the events of interest generated in the Model folder child nodes.

  4. Next to EventType, click image3 and select AuditWriteUpdateEventType.

  5. Set Non-interactive sessions excluded to True.

  6. In Project, double-click the Event logger object: the list of properties of the selected event type is displayed in the object editor.

Select the event properties of interest

  1. Double-click the Event logger: the complete list of the event type AuditWriteUpdateEventType properties appears in the editor.

  2. Select the following properties.

    Properties

    Description

    SourceName

    Node BrowseName

    SourceNode

    Node path

    Time

    Timestamp of the action performed by the user

    ClientUserID

    Session user ID

    AttributeId

    Name of edited attribute

    NewValue

    New attribute value

    OldValue

    Old attribute value

  3. Click Apply to confirm the properties to record: the properties appear in Event fields to log. Columns corresponding to the selected properties are automatically created in the database.

Note

when a property to record is selected, a dynamic link with it is automatically set inside Event fields to log. The dynamic link points to an attribute automatically selected by Q Studio. If the attribute does not represent the data of interest, select a different attribute in the dynamic link window.

Configure a custom property for the event

Custom properties can be added in addition to the native properties of the event of interest.

The custom property ValueChange was added in the example project, i.e. a localizable string that displays the OldValue and NewValue values of the attribute that was changed.

  1. To add a property to record, click image4 next to Event fields to log: the new property appears, renamed ValueChange in the example project.

  2. To use the OldValue and NewValue values in the property, an advanced dynamic link must be configured using a String formatter type converter. Refer to the example project for the configuration. For details on the converter, refer to String formatter.

See also

Related concepts

Event logger

Related procedures

Use the Event loggers