We have an automatic deploy system so whenever someone pushes something on the main branch, a new docker container is created and the old one destroyed.
Naturally, all logs are no longer accessible for the old container at that time.
Is it possible to do something like, before the old container is destroyed, copy all the logs to a location, destroy the container and start up a new one?
2
Answers
Use a volume, store the logs there. You could also try and change log drivers: https://docs.docker.com/config/containers/logging/configure/
As json and text container logs are stored in the container path, they do have the very desirable property that when the container is cleaned up, so are they.
So, your options are:
awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog