Skip to content

Commit

Permalink
Include container healthcheck logs for unhealthy containers
Browse files Browse the repository at this point in the history
The product tests fail the environment startup if all containers are not
healthy and log the name of the unhealthy container. Since the logs
don't include the healthcheck logs from Docker it's impossible to find
why the container appeared unhealthy. This change additionally logs the
healthcheck responses from the Docker daemon for unhealhty containers.
  • Loading branch information
hashhar committed Nov 2, 2022
1 parent 150f7cc commit 817f457
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -349,7 +349,7 @@ private static boolean containerIsHealthy(DockerContainer container)
}

if (!container.isHealthy()) {
log.warn("Container %s is not healthy", container.getLogicalName());
log.warn("Container %s is not healthy, logs of container healthcheck:\n%s", container.getLogicalName(), container.getCurrentContainerInfo().getState().getHealth().getLog());
return false;
}

Expand Down

0 comments on commit 817f457

Please sign in to comment.