Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit bf33a43

Browse files
committed
Fix Log when service uses containerName
Signed-off-by: Vincent Demeester <[email protected]>
1 parent 3f9fc90 commit bf33a43

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docker/service.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,9 @@ func (s *Service) Log(ctx context.Context, follow bool) error {
577577
return err
578578
}
579579
name := fmt.Sprintf("%s_%d", s.name, containerNumber)
580+
if s.Config().ContainerName != "" {
581+
name = s.Config().ContainerName
582+
}
580583
l := s.context.LoggerFactory.CreateContainerLogger(name)
581584
return c.Log(ctx, l, follow)
582585
})

0 commit comments

Comments
 (0)