From 3b831dad911e9bbcc03c3bb1e43bfc41977ca8e1 Mon Sep 17 00:00:00 2001 From: Zhonghui Hu <“hzhonghu@amazon.com”> Date: Mon, 19 Oct 2020 13:03:18 -0700 Subject: [PATCH] cleanup err message and log message --- cloudwatch/cloudwatch.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cloudwatch/cloudwatch.go b/cloudwatch/cloudwatch.go index a02881a..cf6b2f0 100644 --- a/cloudwatch/cloudwatch.go +++ b/cloudwatch/cloudwatch.go @@ -650,17 +650,17 @@ func (output *OutputPlugin) putLogEvents(stream *logStream) error { logrus.Errorf("[cloudwatch %d] Encountered error %v; detailed information: %s\n", output.PluginInstanceID, awsErr, awsErr.Message()) if strings.Contains(awsErr.Message(), "group") { if err := output.createLogGroup(&Event{group: stream.logGroupName}); err != nil { - logrus.Error(err) + logrus.Errorf("[cloudwatch %d] Encountered error %v\n", output.PluginInstanceID, err) return err } } else if strings.Contains(awsErr.Message(), "stream") { if _, err := output.createStream(&Event{group: stream.logGroupName, stream: stream.logStreamName}); err != nil { - logrus.Error(err) + logrus.Errorf("[cloudwatch %d] Encountered error %v\n", output.PluginInstanceID, err) return err } } - return fmt.Errorf("[cloudwatch %d] A Log group/stream did not exist, re-created it. Will retry PutLogEvents on next flush", output.PluginInstanceID) + return fmt.Errorf("A Log group/stream did not exist, re-created it. Will retry PutLogEvents on next flush") } else { output.timer.Start() return err