From a0620af9818d36353241a518d00ba34ab2ff9d11 Mon Sep 17 00:00:00 2001 From: Josh Dover <1813008+joshdover@users.noreply.github.com> Date: Mon, 19 Sep 2022 13:15:45 +0200 Subject: [PATCH] Use at least warning level for all status logs (#1218) --- CHANGELOG.next.asciidoc | 1 + internal/pkg/core/status/reporter.go | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 6047c71b3d7..b2fc7413192 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -114,6 +114,7 @@ - Agent updates will clean up unneeded artifacts. {issue}693[693] {issue}694[694] {pull}752[752] - Use the Elastic Agent configuration directory as the root of the `inputs.d` folder. {issues}663[663] - Fix a panic caused by a race condition when installing the Elastic Agent. {issues}806[806] +- Use at least warning level for all status logs {pull}1218[1218] - Remove fleet event reporter and events from checkin body. {issue}993[993] ==== New features diff --git a/internal/pkg/core/status/reporter.go b/internal/pkg/core/status/reporter.go index 9e0f47a9b56..848a69326e6 100644 --- a/internal/pkg/core/status/reporter.go +++ b/internal/pkg/core/status/reporter.go @@ -250,10 +250,9 @@ func (r *controller) updateStatus() { } func (r *controller) logStatus(status AgentStatusCode, message string) { - logFn := r.log.Infof - if status == Degraded { - logFn = r.log.Warnf - } else if status == Failed { + // Use at least warning level log for all statuses to make sure they are visible in the logs + logFn := r.log.Warnf + if status == Failed { logFn = r.log.Errorf }