From aa90cda3a2d6fa754e15d64d063886136a172679 Mon Sep 17 00:00:00 2001 From: Rudy Zhang Date: Fri, 27 Apr 2018 14:43:11 +0800 Subject: [PATCH] bugfix: modify log format Modify log format to "time.RFC3339Nano=2006-01-02T15:04:05.999999999Z07:00" Signed-off-by: Rudy Zhang --- daemon/mgr/network.go | 4 ++-- main.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/daemon/mgr/network.go b/daemon/mgr/network.go index dacbabd57..0ff450802 100644 --- a/daemon/mgr/network.go +++ b/daemon/mgr/network.go @@ -6,6 +6,7 @@ import ( "net" "path" "strings" + "time" apitypes "github.com/alibaba/pouch/apis/types" "github.com/alibaba/pouch/daemon/config" @@ -486,9 +487,8 @@ func initNetworkLog(cfg *config.Config) { } formatter := &netlog.TextFormatter{ - ForceColors: true, FullTimestamp: true, - TimestampFormat: "2006-01-02 15:04:05.000000000", + TimestampFormat: time.RFC3339Nano, } netlog.SetFormatter(formatter) } diff --git a/main.go b/main.go index b51c3496e..ad4343fa6 100644 --- a/main.go +++ b/main.go @@ -8,6 +8,7 @@ import ( "path" "strings" "syscall" + "time" "github.com/alibaba/pouch/daemon" "github.com/alibaba/pouch/daemon/config" @@ -239,7 +240,7 @@ func initLog() { formatter := &logrus.TextFormatter{ FullTimestamp: true, - TimestampFormat: "2006-01-02 15:04:05.000000000", + TimestampFormat: time.RFC3339Nano, } logrus.SetFormatter(formatter) }