Logs¶
The Execution Log is a very powerful way to record outputs, track execution and collect metrics from your automation. In this section you will find how to manipulate Logs via SDK.
BotCity Orchestrator
You can also make use of the Execution Log functionality directly on the BotCity Orchestrator platform.
See more at:
Create a log¶
You can create a custom Log to collect task execution data.
To create a new Log, you need the following information:
- Label: unique identifier of the Log to be created.
- Columns: List of columns that make up the Log, defined with the
Columnclass:name: Friendly name displayed in the BotCity Orchestrator.label: Unique identifier for this column in the Log.width:(optional)Suggested width in pixels.
Attention!
The SDK provides the Column class that helps create the list of Log columns.
See an example of Log creation:
Create Log entries¶
With the Log created, each Log entry records a new row with data collected by the automation.
To create a Log entry, you need the following information:
- Label: unique identifier of the already created Log.
- Values: key
(column label)and value based on the created columns.
See an example of a Log entry:
What types of values are accepted?
Logs record output information for execution monitoring. Therefore, the values passed to each column must be JSON serializable objects.
For sending more complex data, see the option: Result files.
Fetch Log data¶
You can return log records filtered by date.
To fetch a Log, you need the following information:
- Label: unique identifier of the already created Log.
- Date: start date to filter the records search.
Date Filter
The date parameter must use the DD/MM/YYYY format. If date is not provided, all log data will be retrieved.
See the implementation example:
Download as CSV¶
You can return Log records and save them as a .CSV file.
See the example:
Delete an entire Log¶
You can delete an entire Log along with all its records irreversibly.
Attention!
This operation will delete the ENTIRE Log record history and cannot be undone.
See an example of how to delete the Log: