logspout icon indicating copy to clipboard operation
logspout copied to clipboard

Missing container logs when using docker-compose up

Open abhaygupta97 opened this issue 4 years ago • 0 comments

I have a docker-compose.yml file which starts logspout container and other containers in my application. On doing docker-compose up, in some cases log files are not getting created for some containers.

When log files are not getting created, I saw in logspout logs that container log is getting created in pump.Run but not getting started. Eg: In following case for 2961bd4368e6, we see there is create log but no start log

2021/09/09 15:22:52 pump.Run() event: 6816c90083fc create
**2021/09/09 15:22:52 pump.Run() event: 2961bd4368e6 create**
2021/09/09 15:22:52 pump.Run() event: c5af90f76a7a create
2021/09/09 15:22:53 pump.Run() event: 6816c90083fc start
2021/09/09 15:22:53 pump.pumpLogs(): 6816c90083fc started, tail: all
2021/09/09 15:22:54 pump.Run() event: c5af90f76a7a start
2021/09/09 15:22:54 pump.pumpLogs(): c5af90f76a7a started, tail: all

Restarting the container for which logs are missing using sudo -E docker-compose -f <compose-file-path> restart <container-name> fixes the issue.

How to ensure that log files are not missing when doing docker-compose up?

abhaygupta97 avatar Sep 09 '21 17:09 abhaygupta97