From 2c4fc2008693f438e34f96d99f7c9234f8545de8 Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Mon, 8 Jan 2024 21:21:36 +0100 Subject: [PATCH] logging: full standard timestamp with timezone (yyyy-mm-dd) (#86) --- .github/workflows/tests_deb.yml | 1 + pkg/cfg/logging.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests_deb.yml b/.github/workflows/tests_deb.yml index a0eff4f..396e8f2 100644 --- a/.github/workflows/tests_deb.yml +++ b/.github/workflows/tests_deb.yml @@ -35,6 +35,7 @@ jobs: - name: Install functional test dependencies run: | + sudo apt update sudo apt install -y build-essential debhelper devscripts fakeroot lintian docker network create net-test python3 -m pip install --upgrade pipenv wheel diff --git a/pkg/cfg/logging.go b/pkg/cfg/logging.go index 098ea2f..496d656 100644 --- a/pkg/cfg/logging.go +++ b/pkg/cfg/logging.go @@ -5,6 +5,7 @@ import ( "io" "os" "path/filepath" + "time" log "github.com/sirupsen/logrus" "github.com/sirupsen/logrus/hooks/writer" @@ -93,7 +94,7 @@ func (c *LoggingConfig) setup(fileName string) error { return nil } - log.SetFormatter(&log.TextFormatter{TimestampFormat: "02-01-2006 15:04:05", FullTimestamp: true}) + log.SetFormatter(&log.TextFormatter{TimestampFormat: time.RFC3339, FullTimestamp: true}) logger, err := c.LoggerForFile(fileName) if err != nil {