Automatic Diagnostic Repository - managing logs of PostgreSQL containers to simplify diagnostics.
Goal
If an error occurs at the snapshot preparation stage, or if the clone was created with an error, postgres containers and data directory (with a log
directory) are immediately deleted, and this can significantly complicate the diagnosis of the problem.
It is necessary to add logic for managing logs of PostgreSQL containers to simplify diagnostics.
TODO / How to implement
After receiving the error, before the container is deleted, its postgres logs should be copied to a specific directory - "diag" "logs
"
example:
~/.dblab/engine/logs/20220426/<dblab_ld_xxxxxx>/<logfile>
where is the subdirectory in the format %Y%m%d
for further rotation.
<dblab_ld_xxxxxx>
- container name.
see comments #349 (comment 943891805)
Acceptance criteria
- We have a single diagnostic directory where we can access error logs from all postgres instances for handling diagnostic information.
- Options are described in the docs
Edited by Vitaliy Kukharik