Skip to content

Commit

Permalink
fix: update root logger after autologs
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed May 22, 2024
1 parent 12204bf commit ffecf59
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,14 @@ func Run(f func(ctx context.Context, lg *zap.Logger, m *Metrics) error, op ...Op
if err != nil {
panic(fmt.Sprintf("failed to get resource: %v", err))
}

// Setup logs.
if ctx, err = autologs.Setup(ctx, res); err != nil {
panic(fmt.Sprintf("failed to setup logs: %v", err))
}
// Update root logger after autologs setup.
lg = zctx.From(ctx)

m, err := newMetrics(ctx, lg.Named("metrics"), res, opts.meterOptions, opts.tracerOptions)
if err != nil {
panic(err)
Expand Down

0 comments on commit ffecf59

Please sign in to comment.