From 5751166ebcbc3da70a76d0ec6ca972cf001bb3b6 Mon Sep 17 00:00:00 2001 From: Xavier Michelon Date: Tue, 9 Jan 2024 09:24:21 +0100 Subject: [PATCH] feat(GODT-3155): customize log formatter for easier parsing. --- internal/logging/logging.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/logging/logging.go b/internal/logging/logging.go index 2ba6f7ea..2faaab72 100644 --- a/internal/logging/logging.go +++ b/internal/logging/logging.go @@ -91,9 +91,11 @@ func (cs *coloredStdOutHook) Fire(entry *logrus.Entry) error { // the default pruning algorithm. func Init(logsPath string, sessionID SessionID, appName AppName, rotationSize, pruningSize int64, level string) (io.Closer, error) { logrus.SetFormatter(&logrus.TextFormatter{ - DisableColors: true, - FullTimestamp: true, - TimestampFormat: time.StampMilli, + DisableColors: true, + ForceQuote: true, + FullTimestamp: true, + QuoteEmptyFields: true, + TimestampFormat: "2006-01-02 15:04:05.000", }) logrus.AddHook(newColoredStdOutHook())