File logs and docker
Hey,
I have a web api which uses serilog to log into files. Whenever it runs in a container those logs are also contained in the container. As far as I understand after container stops running logs are lost. I'm aware of log driver but haven't read enough yet. So I basically want to retrieve those files/logs. Maybe anyone could point me to a "good practice" or a solution for this kind of problem?
1 Reply
Are you able to configure the container such that the API logs to a host directory?
You can kill or swap the container without losing your logs
For example, API logs to /var/log/myApi, which is bound to some dir on the host