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
  • Loading branch information
joshdover committed Sep 19, 2022
1 parent 5a0ba4d commit a0620af
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 @@ -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
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 a0620af

Please sign in to comment.