Skip to content

Commit

Permalink
fixed milli time
Browse files Browse the repository at this point in the history
  • Loading branch information
d80tb7 committed Jan 7, 2025
1 parent 951ab70 commit 10f4813
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/common/logging/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
var (
defaultLogConfigPath = "config/logging.yaml"
logConfigPathEnvVar = "ARMADA_LOG_CONFIG"
logTimestampFormat = "2006-01-02T15:04:05.999Z07:00"
RFC3339Milli = "2006-01-02T15:04:05.000Z07:00"
)

// MustConfigureApplicationLogging sets up logging suitable for an application. Logging configuration is loaded from
Expand Down Expand Up @@ -102,7 +102,7 @@ func createConsoleLogger(logConfig Config) (*FilteredLevelWriter, error) {
level: level,
writer: zerolog.ConsoleWriter{
Out: os.Stdout,
TimeFormat: logTimestampFormat,
TimeFormat: RFC3339Milli,
FormatLevel: func(i interface{}) string {
return strings.ToUpper(fmt.Sprintf("%s", i))
},
Expand Down
3 changes: 1 addition & 2 deletions internal/common/logging/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package logging
import (

Check failure on line 3 in internal/common/logging/global.go

View workflow job for this annotation

GitHub Actions / lint / Lint Go

File is not `gofumpt`-ed (gofumpt)
"github.com/rs/zerolog"

Check failure on line 4 in internal/common/logging/global.go

View workflow job for this annotation

GitHub Actions / lint / Lint Go

File is not `goimports`-ed with -local github.com/armadaproject/armada (goimports)
"os"

Check failure on line 5 in internal/common/logging/global.go

View workflow job for this annotation

GitHub Actions / lint / Lint Go

File is not `gofumpt`-ed (gofumpt)
"time"
)

// The global Logger. Comes configured with some sensible defaults for e.g. unit tests, but applications should
Expand Down Expand Up @@ -102,7 +101,7 @@ func WithStacktrace(err error) *Logger {
func createDefaultLogger() *Logger {
consoleWriter := zerolog.ConsoleWriter{
Out: os.Stdout,
TimeFormat: time.RFC3339,
TimeFormat: RFC3339Milli,
NoColor: true,
}
zerologLogger := zerolog.New(consoleWriter).
Expand Down

0 comments on commit 10f4813

Please sign in to comment.