diff --git a/exporter/sumologicexporter/sender.go b/exporter/sumologicexporter/sender.go index 972463a6cfa9..b8577be84778 100644 --- a/exporter/sumologicexporter/sender.go +++ b/exporter/sumologicexporter/sender.go @@ -134,11 +134,14 @@ func (s *sender) sendLogs(flds fields) ([]pdata.LogRecord, error) { errs []error droppedRecords []pdata.LogRecord currentRecords []pdata.LogRecord - formattedLine string - err error ) for _, record := range s.buffer { + var ( + formattedLine string + err error + ) + switch s.config.LogFormat { case TextFormat: formattedLine, err = s.logToText(record)