Skip to content

Commit

Permalink
Use at least warning level for all status logs (#1218)
Browse files Browse the repository at this point in the history
(cherry picked from commit a0620af)
  • Loading branch information
joshdover authored and mergify[bot] committed Sep 19, 2022
1 parent c9590b5 commit 07ac213
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions internal/pkg/core/status/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 07ac213

Please sign in to comment.