Skip to content

Commit 96e6d80

Browse files
committed
skip non-UTF (binary) data
1 parent 53f0697 commit 96e6d80

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

multiline.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"strings"
66
"sync"
77
"time"
8+
"unicode/utf8"
89
)
910

1011
var (
@@ -57,6 +58,10 @@ func (m *MultilineCollector) dispatch(ctx context.Context) {
5758
}
5859

5960
func (m *MultilineCollector) Add(entry LogEntry) {
61+
if !utf8.ValidString(entry.Content) {
62+
return
63+
}
64+
6065
m.lock.Lock()
6166
defer m.lock.Unlock()
6267

0 commit comments

Comments
 (0)