The SImA installation base directory contains a script for collecting the log files: get_logs.sh
. This script generates a zip package containing Docker service logs from the running container stack, along with important configuration files.
Generating a Full Log Set
To generate a complete set of stored logs, use the following command:
get_logs.sh collect
The logs will be outputted to sima_logs_latest.zip
Requesting Logs from a Specific Time Period
You can request logs from a specific time period by providing optional --from
and/or --to
dates arguments:
get_logs.sh collect --from [start_collection_time] --to [end_collection_time]
Time should be given according to ISO-8601 format (including timezone).
Example Command
get_logs.sh collect --from 2021-05-18T11:11:26+03:00 --to 2021-05-18T11:11:56+03:00
The logs are outputted to sima_logs_from-<start_collection_time>-to-<end_collection_time>.zip
Retrieving Current Time in ISO-8601 Format
To retrieve the current time in the ISO-8601 format, use the Linux command:
date -Is
For UTC time, the syntax is yyyy-MM-ddTHH:mm:ssZ
.
Simplifying Log Collection for a Specific Period
You can pass the desired collection period as a string to the date
command. The example below collects logs for the past 24-hour period:
get_logs.sh collect --from $(date -Is -d "1 days ago")
Comments
0 comments
Article is closed for comments.