From d872a13aebeecd1fda7e56811aa72c2e1154292c Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Fri, 15 Jan 2021 14:16:06 -0500 Subject: [PATCH 1/3] Add fractional seconds (milliseconds) to logrus.JSONFormatter. --- test/sdk-echo-server/sdk-echo-server.go | 2 +- test/zapp-fortio-grpc-server/zapp-fortio-grpc-server.go | 2 +- ziti-controller/subcmd/root.go | 2 +- ziti-probe/subcmd/root.go | 2 +- ziti-router/subcmd/root.go | 2 +- ziti-tunnel/cmd/ziti-tunnel/subcmd/root.go | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/sdk-echo-server/sdk-echo-server.go b/test/sdk-echo-server/sdk-echo-server.go index c084aa68a..5f2e9a318 100644 --- a/test/sdk-echo-server/sdk-echo-server.go +++ b/test/sdk-echo-server/sdk-echo-server.go @@ -52,7 +52,7 @@ var root = &cobra.Command{ case "pfxlog": logrus.SetFormatter(pfxlog.NewFormatterStartingToday()) case "json": - logrus.SetFormatter(&logrus.JSONFormatter{}) + logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: "2006-01-02T15:04:05.000Z"}) case "text": logrus.SetFormatter(&logrus.TextFormatter{}) default: diff --git a/test/zapp-fortio-grpc-server/zapp-fortio-grpc-server.go b/test/zapp-fortio-grpc-server/zapp-fortio-grpc-server.go index 1b42d5b12..0882e863a 100644 --- a/test/zapp-fortio-grpc-server/zapp-fortio-grpc-server.go +++ b/test/zapp-fortio-grpc-server/zapp-fortio-grpc-server.go @@ -58,7 +58,7 @@ var root = &cobra.Command{ case "pfxlog": logrus.SetFormatter(pfxlog.NewFormatterStartingToday()) case "json": - logrus.SetFormatter(&logrus.JSONFormatter{}) + logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: "2006-01-02T15:04:05.000Z"}) case "text": logrus.SetFormatter(&logrus.TextFormatter{}) default: diff --git a/ziti-controller/subcmd/root.go b/ziti-controller/subcmd/root.go index 1fe6ff434..d902305e3 100644 --- a/ziti-controller/subcmd/root.go +++ b/ziti-controller/subcmd/root.go @@ -46,7 +46,7 @@ var root = &cobra.Command{ case "pfxlog": logrus.SetFormatter(pfxlog.NewFormatterStartingToday()) case "json": - logrus.SetFormatter(&logrus.JSONFormatter{}) + logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: "2006-01-02T15:04:05.000Z"}) case "text": logrus.SetFormatter(&logrus.TextFormatter{}) default: diff --git a/ziti-probe/subcmd/root.go b/ziti-probe/subcmd/root.go index 6fc95e321..5e28c439b 100644 --- a/ziti-probe/subcmd/root.go +++ b/ziti-probe/subcmd/root.go @@ -43,7 +43,7 @@ var root = &cobra.Command{ case "pfxlog": logrus.SetFormatter(pfxlog.NewFormatterStartingToday()) case "json": - logrus.SetFormatter(&logrus.JSONFormatter{}) + logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: "2006-01-02T15:04:05.000Z"}) case "text": logrus.SetFormatter(&logrus.TextFormatter{}) default: diff --git a/ziti-router/subcmd/root.go b/ziti-router/subcmd/root.go index 5af86407f..844577e88 100644 --- a/ziti-router/subcmd/root.go +++ b/ziti-router/subcmd/root.go @@ -42,7 +42,7 @@ var root = &cobra.Command{ case "pfxlog": logrus.SetFormatter(pfxlog.NewFormatterStartingToday()) case "json": - logrus.SetFormatter(&logrus.JSONFormatter{}) + logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: "2006-01-02T15:04:05.000Z"}) case "text": logrus.SetFormatter(&logrus.TextFormatter{}) default: diff --git a/ziti-tunnel/cmd/ziti-tunnel/subcmd/root.go b/ziti-tunnel/cmd/ziti-tunnel/subcmd/root.go index 2edd5f3c9..54849148d 100644 --- a/ziti-tunnel/cmd/ziti-tunnel/subcmd/root.go +++ b/ziti-tunnel/cmd/ziti-tunnel/subcmd/root.go @@ -78,7 +78,7 @@ func rootPreRun(cmd *cobra.Command, _ []string) { case "pfxlog": logrus.SetFormatter(pfxlog.NewFormatterStartingToday()) case "json": - logrus.SetFormatter(&logrus.JSONFormatter{}) + logrus.SetFormatter(&logrus.JSONFormatter{TimestampFormat: "2006-01-02T15:04:05.000Z"}) case "text": logrus.SetFormatter(&logrus.TextFormatter{}) default: From 896414714dd3a9b0333043561da9ed5abcf65a68 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Fri, 15 Jan 2021 14:26:46 -0500 Subject: [PATCH 2/3] Release notes. --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94244418e..58c9fc64f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# Release 0.18.3 + +## What's New + +* JSON logging now emits timestamps that include fractional seconds. Timestamps remain in RFC3339 format. + # Release 0.18.2 ## What's New From b5997102c66a0b82c5d67584fade856b68c3f9c1 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Fri, 15 Jan 2021 14:27:25 -0500 Subject: [PATCH 3/3] More better words. --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58c9fc64f..7cba8c0af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## What's New -* JSON logging now emits timestamps that include fractional seconds. Timestamps remain in RFC3339 format. +* Ziti executables that use JSON logging now emit timestamps that include fractional seconds. Timestamps remain in + the RFC3339 format. # Release 0.18.2