file output plugin fixup
This commit is contained in:
parent
9f6666beb3
commit
504f4e69db
|
@ -92,9 +92,13 @@ func (f *File) Write(metrics []telegraf.Metric) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, metric := range metrics {
|
for _, metric := range metrics {
|
||||||
_, err := f.writer.Write(metric.Serialize())
|
b, err := f.serializer.Serialize(metric)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("FAILED to write message: %s, %s", metric.Serialize(), err)
|
return fmt.Errorf("failed to serialize message: %s", err)
|
||||||
|
}
|
||||||
|
_, err = f.writer.Write(b)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to write message: %s, %s", metric.Serialize(), err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue