How to log procedures' execution with timestamps

1. Abstract

Admin users often require checking the time execution of a procedure and even the user who launched it. Board provides a standard functionality to review the logs, but it is possible to put in place a customized solution.

2. Context

In Board, there is a standard functionality to keep track of the execution of a procedure and who launched it through the log. A log file is updated anytime a procedure is launched and it allows to have an overview of all the launched procedures. All the info is stored in a log file and not visible on a screen.

An alternative approach can be put in place through specific procedure steps with the use of substitution formulas. They can be very useful to keep track of the user and the date of a procedure launch.

Some circumstances require to have deep control of the procedure running, for example:

  • on-demand data load, by launching manually a procedure executing a Data Reader
  • a nightly load, by launching automatically a procedure executing a Data Reader
  • a workflow step (i.e., opening or closing of a workflow step).

In the procedure, it is suggested to put at the end one dataflow to log the execution.

3. Content

We will provide the steps to follow to log the execution and the user: at the end of the executed procedure, it is enough to create a dataflow in charge of writing the user and/or the date on specific a cube.

This cube needs to be a text one and detailed by a dimension representing the event which the procedure is referring to.

To log the user, it is possible to use the formulas @username or @user, while the @time, the @date and the @datetime return the current time string.

3.1 How to steps

1. Creation of an Event entity: this dimension should represent the event corresponding to when the procedure is launched.

2. Creation of a Log Execution cube: this should be detailed by the Event entity.

3. Create a procedure to select the desired event and a dataflow to write. The dataflow writes the information needed in the Log Execution cube: it is necessary firstly to select the considered Event and then use the substitution formulas to track the desired details.

It is even possible to combine substitution formulas with strings and create a personalized message.

Remarks

  • To enhance the provided information and help users in optimizing runtimes or in troubleshooting situations where the procedure started successfully but did not finish properly, it is usually recommended to log both the start and the end of the procedure, by creating more elements in the Event entity and with two different dataflows in the procedure.
  • The example provided above represents a simplified situation; if the events happen in specific clusters, the Log Execution cube needs to consider it and be detailed by the corresponding entities (for example: Planning Unit, Legal Entity, Cost Center, …).