From d3dd27c62e6c3121c17415bb2b97b2b7b51ddbda Mon Sep 17 00:00:00 2001 From: lab Date: Tue, 14 May 2024 13:06:49 +0800 Subject: [PATCH] fix: log output --- cmd/cert-exporter/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/cert-exporter/main.go b/cmd/cert-exporter/main.go index c3fe29b..33b0ed6 100644 --- a/cmd/cert-exporter/main.go +++ b/cmd/cert-exporter/main.go @@ -292,13 +292,13 @@ func FindDockerContainersAndRestart(label string) error { noWaitTimeout := 0 for _, ctr := range containers { - log.Info("found container: %s %s (status: %s)\n", ctr.ID, ctr.Image, ctr.Status) + log.Info("found container:", "id", ctr.ID, "image", ctr.Image, "status", ctr.Status) err := apiClient.ContainerRestart(ctx, ctr.ID, container.StopOptions{ Timeout: &noWaitTimeout, }) if err != nil { - log.Error("failed to restart docker container with label %s, %w", label, err) + log.Error("failed to restart docker container", "id", ctr.ID, "image", ctr.Image, "label", label, "error", err) } }