Skip to content

Commit

Permalink
logging: full standard timestamp with timezone (yyyy-mm-dd) (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc authored Jan 8, 2024
1 parent eac31f8 commit c362189
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 c362189

Please # to comment.