From 07ac213bf1b64a5a4eee30ecbbd6dd4f52fd4044 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) (cherry picked from commit a0620af9818d36353241a518d00ba34ab2ff9d11) --- 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 598032dfc3f..29b155ee8c6 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -113,6 +113,7 @@ - Fix data duplication for standalone agent on Kubernetes using the default manifest {issue-beats}31512[31512] {pull}742[742] - Agent updates will clean up unneeded artifacts. {issue}693[693] {issue}694[694] {pull}752[752] - 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 92632af2ed5..556596f17e5 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 }