Adding Standard Event Handling to Your Application
Logging standard events requires that you include appropriate elements in your application definitions:
- Open your application's _Settings definition in Studio and add an Event Logging element, as shown above. Set its Log Events attribute to True. This attribute can be used to toggle event logging on and off. Tokens cannot be used in this attribute value.
- Below the Event Logging element, add a Log Event element and set its Event Name attribute to the type of event to be logged, as shown above. The Event Name attribute value has a drop-down list of the valid events, which are discussed in detail later in this topic. Multiple Log Event elements can be added in order to provide logging of different types of events.
The optional Event Element ID Filter attribute may be used to "zero-in" on the behavior of a specific element. You identify the element, by its ID, as the only element for which events of this type should be handled. Events of this type generated by other elements will then be ignored.
- Add a standard Action.Process element below each Log Event element, as shown above. The Process Definition File and TaskID attributes identify the definition file and task, respectively, that will be called when the event fires.
- The final step is to create a process task to handle the information provided when the event fires. A sample task is shown above.
This is an example of an SQL statement that adds the logging information to a database. Notice the tokens used in the VALUES clause:
- INSERT INTO myLog (EventName, ElementID, EventTime, SPName)
VALUES ('@Request.EventName~', '@Request.ElementID~', @Request.EventTime~, '@Request.SP~')