From b691a44b47b3d443cf9fa462190069ed5ff5b98f Mon Sep 17 00:00:00 2001 From: William Dumont Date: Thu, 29 Feb 2024 15:02:48 +0100 Subject: [PATCH] ignore errors when the logging node empties the log buffer (#6558) --- CHANGELOG.md | 4 ++++ pkg/flow/logging/logger.go | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 183490b615..b9988a7fe3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ Main (unreleased) - A new `loki.rules.kubernetes` component that discovers `PrometheusRule` Kubernetes resources and loads them into a Loki Ruler instance. (@EStork09) +### Bugfixes + +- Fix an issues where the logging config block would trigger an error when trying to send logs to components that were not running. (@wildum) + v0.40.0 (2024-02-27) -------------------- diff --git a/pkg/flow/logging/logger.go b/pkg/flow/logging/logger.go index da0046a281..5689d00fe0 100644 --- a/pkg/flow/logging/logger.go +++ b/pkg/flow/logging/logger.go @@ -126,9 +126,9 @@ func (l *Logger) Update(o Options) error { // Print out the buffered logs since we determined the log format already for _, bufferedLogChunk := range l.buffer { - if err := slogadapter.GoKit(l.handler).Log(bufferedLogChunk...); err != nil { - return err - } + // the buffered logs are currently only sent to the standard output + // because the components with the receivers are not running yet + slogadapter.GoKit(l.handler).Log(bufferedLogChunk...) } l.buffer = nil