Access Logs in the SDK
Overview
Programmatic log access allows users to retrieve workflow execution records through the SDK, eliminating the need for manual downloads. Logs include key details like timestamps, statuses, and instrument interactions. This feature enables automated compliance tracking by exporting logs for a specific workcell within a given time range, saving them as Excel files in a designated directory.
Note
Ensure you have the necessary permissions to retrieve logs. Contact Automata if access is restricted.
Create a target folder
Before exporting logs, create a folder where the logs will be saved.
mkdir /path/to/logs
Replace /path/to/logs
with the desired directory path.
Export Logs
List available Workcells
Before exporting logs, you need to identify the correct workcell ID. To retrieve a list of available workcells, run the following command:
linq workcell list
This command returns a list of workcells, including their IDs.
Execute the Export Command
Once you have identified the correct workcell ID, you can use the export-run-logs
command to retrieve logs for a specific date range and save them to a designated directory. The command requires:
Workcell ID – The identifier for the workcell whose logs you want to retrieve.
Date – The starting point for log retrieval (logs from this date onward will be exported). The date can be provided in one of the following formats:
YYYY-MM-DD
→ Defaults to midnight (00:00:00) on the specified date.YYYY-MM-DDTHH:MM:SS
→ Full ISO 8601 format specifying the exact date and time.YYY-MM-DD HH:MM:SS
→ Similar to the previous format but with a space instead ofT
.
Export Directory – The location where the log files will be saved.
Use the following command to export logs:
linq export-run-logs \
--workcell-id=<workcellID> \
--from-date=<'YYYY-MM-DDTHH:MM:SS'> \
--output_dir=/path/to/logs
The SDK will process the request, retrieving workflow logs from the specified date onward. Each log file will be downloaded and stored in the export directory as an Excel file.
During the export process, a progress bar will appear, indicating the download progress of each log file as well as the overall progress of all logs being retrieved. If a workflow is still running at the time of retrieval, part of its log will be exported and marked as a partial log. To retrieve the full log, you will need to re-run the export command after the workflow has completed.
Access and View Exported Logs
Once logs are exported, you can view them using any spreadsheet application or parse them programmatically as needed. The files will be stored in the designated export directory in Excel format (.xlsx
).