Skip to content

Commit

Permalink
logging: full standard timestamp with timezone (yyyy-mm-dd) (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc authored Jan 8, 2024
1 parent bf40771 commit 20c902e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/tests_deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion pkg/cfg/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"io"
"os"
"path/filepath"
"time"

log "github.com/sirupsen/logrus"
"github.com/sirupsen/logrus/hooks/writer"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 20c902e

Please sign in to comment.