Skip to content

Commit

Permalink
fix: logger scopes (#3705)
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas authored Dec 10, 2024
1 parent 8638cfe commit 8dfca46
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/cron/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func (c cronJob) String() string {
// Start the cron service. Blocks until the context is cancelled.
func Start(ctx context.Context, eventSource schemaeventsource.EventSource, client routing.CallClient) error {
logger := log.FromContext(ctx).Scope("cron")
ctx = log.ContextWithLogger(ctx, logger)
// Map of cron jobs for each module.
cronJobs := map[string][]cronJob{}
// Cron jobs ordered by next execution.
Expand Down
1 change: 1 addition & 0 deletions backend/ingress/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type service struct {
// Start the HTTP ingress service. Blocks until the context is cancelled.
func Start(ctx context.Context, config Config, schemaEventSource schemaeventsource.EventSource, client routing.CallClient) error {
logger := log.FromContext(ctx).Scope("http-ingress")
ctx = log.ContextWithLogger(ctx, logger)
svc := &service{
view: syncView(ctx, schemaEventSource),
client: client,
Expand Down
1 change: 1 addition & 0 deletions backend/lease/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func Start(ctx context.Context, config Config) error {
svc := &service{
leases: make(map[string]*time.Time),
}
ctx = log.ContextWithLogger(ctx, logger)

logger.Debugf("Lease service listening on: %s", config.Bind)
err := rpc.Serve(ctx, config.Bind,
Expand Down
1 change: 1 addition & 0 deletions backend/timeline/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func Start(ctx context.Context, config Config) error {
config.SetDefaults()

logger := log.FromContext(ctx).Scope("timeline")
ctx = log.ContextWithLogger(ctx, logger)
svc := &service{
config: config,
events: make([]*timelinepb.Event, 0),
Expand Down

0 comments on commit 8dfca46

Please sign in to comment.