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 1, 2022
1 parent 4f5bc7c commit b1aac9f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
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 b1aac9f

Please sign in to comment.