Skip to content

Commit adfc83a

Browse files
mpfz0rthll
andauthored
Only log the disablement of send_status once (#448)
* Only log the disablement of send_status once * Add missing trailing space to log message. Co-authored-by: Othello Maurer <othello@graylog.com>
1 parent d0a7234 commit adfc83a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

api/graylog.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,11 @@ func UpdateRegistration(httpClient *http.Client, checksum string, ctx *context.C
209209
respBody := new(graylog.ResponseCollectorRegistration)
210210
resp, err := c.Do(r, &respBody)
211211
if resp != nil && resp.StatusCode == 400 && strings.Contains(err.Error(), "Unable to map property") {
212-
log.Error("[UpdateRegistration] Sending collector status failed. Disabling `send_status` as fallback! ", err)
213-
ctx.UserConfig.SendStatus = false
212+
log.Error("[UpdateRegistration] Sending collector status failed. ", err)
213+
if ctx.UserConfig.SendStatus {
214+
log.Error("[UpdateRegistration] Disabling `send_status` as fallback.")
215+
ctx.UserConfig.SendStatus = false
216+
}
214217
} else if resp != nil && resp.StatusCode == 304 {
215218
log.Debug("[UpdateRegistration] No update available.")
216219
respBody.NotModified = true

0 commit comments

Comments
 (0)