Skip to content

Commit

Permalink
logging: full standard timestamp with timezone (yyyy-mm-dd)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc committed Jan 8, 2024
1 parent 1ac4635 commit 5e7b2bb
Showing 1 changed file with 2 additions and 1 deletion.
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 @@ -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 {
Expand Down

0 comments on commit 5e7b2bb

Please sign in to comment.