The SImA installation base directory contains a script for collecting the log files: get_logs.sh. The script generates a zip package which contains the Docker service logs from the running container stack, as well as some important config files.
To generate a full log set containing all stored logs:
$ ./get_logs.sh collect
The logs are outputted to sima_logs_latest.zip
To request logs from a certain time period, --from and/or --to dates can be given as optional arguments (including timezone):
$ ./get_logs.sh collect --from yyyy-MM-ddTHH:mm:ss+HH:mm --to yyyy-MM-ddTHH:mm:ss+HH:mm
For example:
$ ./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-2021-05-18T11:11:26+03:00-to-2021-05-18T11:11:56+03:00.zip
You can also pass either the --from or --to time only.
$ ./get_logs.sh collect --from yyyy-MM-ddTHH:mm:ss+HH:mm
Time is given according to ISO-8601 format.
The command 'date -Is' can be used to retrieve the current time in the ISO-8601 format.
The syntax for UTC time is yyyy-MM-ddTHH:mm:ssZ.
To simplify things even further, the desired collection period can be passed as a string to the date
command. The example below would collect 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.