Score:0

Can i use docker logs in docker-compose healtcheck

cn flag

I'd like to know if it's possible to use (or grep) the content of the docker container logs and use that input for a healthcheck of a container.

Currently, I'm running matterbridge in a container. I am bridging a WhatsApp group with a Telegram group. From time to time the connection to WhatsApp breaks and i have to restart the container. The logs (docker-compose logs -f) are then flooded with this message:

level=error msg="Connection failed, underlying error: connection to WhatsApp servers failed

After restarting the container (docker-compose restart) everything is fine again. From my point of view, this is an ideal scenario for a healtcheck in my docker-compose file. But how to incorporate the logs from the docker container?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.