Skip to content

Commit

Permalink
Merge pull request #74 from attestantio/ms-log-timestamp
Browse files Browse the repository at this point in the history
Use millisecond timestamp format by default.
  • Loading branch information
mcdee authored Jan 7, 2025
2 parents 48a4875 + d6355fa commit 0459b25
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- disallow generation of distributed accounts without passphrases
- allow use of keystore wallets
- fix issue where signing with a public key as identifier could fail
- use millisecond-precision timestamps in logs by default

# Version 1.2.0
- add Amazon Secrets Manager (ASM) confidant
Expand Down
2 changes: 2 additions & 0 deletions logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ func initLogging() error {
// local log level the local level is ignored. It is then overridden for each module.
zerolog.SetGlobalLevel(zerolog.TraceLevel)

zerolog.TimeFieldFormat = viper.GetString("logging.timestamp.format")

// Change the output file.
if viper.GetString("log-file") != "" {
f, err := os.OpenFile(util.ResolvePath(viper.GetString("log-file")), os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o600)
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ func fetchConfig() error {
viper.AutomaticEnv()

// Defaults.
viper.SetDefault("logging.timestamp.format", "2006-01-02T15:04:05.000Z07:00")
viper.SetDefault("storage-path", "storage")
viper.SetDefault("process.generation-timeout", 70*time.Second)

Expand Down

0 comments on commit 0459b25

Please sign in to comment.