From c36218937ffbdc472893063f14ee789f2852585b Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Mon, 8 Jan 2024 21:21:41 +0100 Subject: [PATCH] logging: full standard timestamp with timezone (yyyy-mm-dd) (#59) --- .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 9d3874f..8d96d9a 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" @@ -90,7 +91,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 {