diff --git a/pkg/compose/logs.go b/pkg/compose/logs.go index 5544c4923..e586130c1 100644 --- a/pkg/compose/logs.go +++ b/pkg/compose/logs.go @@ -35,12 +35,16 @@ func (s *composeService) Logs(ctx context.Context, projectName string, consumer eg, ctx := errgroup.WithContext(ctx) if options.Follow { + printer := newLogPrinter(consumer) eg.Go(func() error { - printer := newLogPrinter(consumer) return s.watchContainers(ctx, projectName, options.Services, printer.HandleEvent, containers, func(c types.Container) error { return s.logContainers(ctx, consumer, c, options) }) }) + eg.Go(func() error { + _, err := printer.Run(false, "", nil) + return err + }) } for _, c := range containers {