Skip to content

Commit

Permalink
Merge pull request #395 from gatewayd-io/group-name-in-windows-logger
Browse files Browse the repository at this point in the history
Add group name to Windows logger
  • Loading branch information
mostafa authored Dec 27, 2023
2 parents 155edc2 + 56f9d58 commit 2e412bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions logging/logger_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ type LoggerConfig struct {
MaxAge int
Compress bool
LocalTime bool

// group name
Name string
}

// NewLogger creates a new logger with the given configuration.
Expand Down Expand Up @@ -82,6 +85,7 @@ func NewLogger(ctx context.Context, cfg LoggerConfig) zerolog.Logger {
multiWriter := zerolog.MultiLevelWriter(outputs...)
logger := zerolog.New(multiWriter)
logger = logger.With().Timestamp().Logger()
logger = logger.With().Str("group", cfg.Name).Logger()

span.End()

Expand Down

0 comments on commit 2e412bd

Please sign in to comment.