Skip to content

Commit

Permalink
eventstream: use unified logger name with field
Browse files Browse the repository at this point in the history
  • Loading branch information
oxzi committed Jan 10, 2024
1 parent a24ad8e commit 92a649c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/eventstream/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type Client struct {
// Ctx for all web requests as well as internal wait loops.
Ctx context.Context
// Logger to log to.
Logger *logging.Logger
Logger *zap.SugaredLogger

// eventDispatcherEventStream communicates Events to be processed from the Event Stream API.
eventDispatcherEventStream chan *eventMsg
Expand All @@ -76,7 +76,7 @@ func NewClientsFromConfig(
clients := make([]*Client, 0, len(conf.Icinga2Apis))

for _, icinga2Api := range conf.Icinga2Apis {
logger := logs.GetChildLogger(fmt.Sprintf("eventstream-%d", icinga2Api.NotificationsEventSourceId))
logger := logs.GetChildLogger("eventstream").With(zap.Int64("source-id", icinga2Api.NotificationsEventSourceId))
client := &Client{
ApiHost: icinga2Api.Host,
ApiBasicAuthUser: icinga2Api.AuthUser,
Expand Down

0 comments on commit 92a649c

Please sign in to comment.