1
0
Fork 0

fix: logger and context.

This commit is contained in:
Ludovic Fernandez 2019-09-13 19:28:04 +02:00 committed by Traefiker Bot
parent b4c7b90c9e
commit 8e18d37b3d
52 changed files with 231 additions and 183 deletions

View file

@ -85,8 +85,9 @@ func (p *Provider) buildTCPServiceConfiguration(ctx context.Context, container d
}
}
for _, service := range configuration.Services {
err := p.addServerTCP(ctx, container, service.LoadBalancer)
for name, service := range configuration.Services {
ctxSvc := log.With(ctx, log.Str(log.ServiceName, name))
err := p.addServerTCP(ctxSvc, container, service.LoadBalancer)
if err != nil {
return err
}
@ -107,8 +108,9 @@ func (p *Provider) buildServiceConfiguration(ctx context.Context, container dock
}
}
for _, service := range configuration.Services {
err := p.addServer(ctx, container, service.LoadBalancer)
for name, service := range configuration.Services {
ctxSvc := log.With(ctx, log.Str(log.ServiceName, name))
err := p.addServer(ctxSvc, container, service.LoadBalancer)
if err != nil {
return err
}