From 55ac6e4cd827233cbf02c9986cfe682c56c10c4d Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Fri, 24 Jun 2022 16:44:03 +0200 Subject: [PATCH] [Feature] Set Logger format (#1031) --- CHANGELOG.md | 1 + pkg/logging/global.go | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0471a2c63..055b68a77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ - (Bugfix) Allow missing `token` key in License secret - (Feature) Unify agency access - (Feature) Change DBServer Cleanup Logic +- (Feature) Set Logger format ## [1.2.13](https://github.com/arangodb/kube-arangodb/tree/1.2.13) (2022-06-07) - (Bugfix) Fix arangosync members state inspection diff --git a/pkg/logging/global.go b/pkg/logging/global.go index 2b3d42b32..e8b372c61 100644 --- a/pkg/logging/global.go +++ b/pkg/logging/global.go @@ -20,9 +20,18 @@ package logging -import "github.com/rs/zerolog/log" +import ( + "os" + "time" -var global = NewFactory(log.Logger) + "github.com/rs/zerolog" +) + +var global = NewFactory(zerolog.New(zerolog.ConsoleWriter{ + Out: os.Stdout, + TimeFormat: time.RFC3339Nano, + NoColor: true, +}).With().Timestamp().Logger()) func Global() Factory { return global