Skip to content

Commit f0d6197

Browse files
committed
fix scenario where JSON logs have invalid .level values
this happens with the default Fastify logger for example, which uses numerical values, causing an error here leading to EPIPE
1 parent 66d3f9d commit f0d6197

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

internal/logs/writer/writer.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010

1111
"github.com/apex/log"
1212
"github.com/apex/up/internal/util"
13-
"github.com/pkg/errors"
1413
)
1514

1615
// Writer struct.
@@ -60,7 +59,7 @@ func (w *Writer) writeJSON(s string) error {
6059
var e log.Entry
6160

6261
if err := json.Unmarshal([]byte(s), &e); err != nil {
63-
return errors.Wrap(err, "unmarshaling")
62+
return w.writeText(s)
6463
}
6564

6665
switch e.Level {

0 commit comments

Comments
 (0)