diff --git a/api/compose/api.go b/api/compose/api.go index b63c244fc..1d8c0d422 100644 --- a/api/compose/api.go +++ b/api/compose/api.go @@ -324,6 +324,7 @@ type ServiceStatus struct { type LogOptions struct { Services []string Tail string + Since string Follow bool Timestamps bool } diff --git a/cli/cmd/compose/logs.go b/cli/cmd/compose/logs.go index f89b13b4e..56d5ef380 100644 --- a/cli/cmd/compose/logs.go +++ b/cli/cmd/compose/logs.go @@ -32,6 +32,7 @@ type logsOptions struct { composeOptions follow bool tail string + since string noColor bool noPrefix bool timestamps bool @@ -50,6 +51,7 @@ func logsCommand(p *projectOptions, contextType string, backend compose.Service) } flags := logsCmd.Flags() flags.BoolVarP(&opts.follow, "follow", "f", false, "Follow log output.") + flags.StringVar(&opts.since, "since", "", "Show logs since timestamp (e.g. 2013-01-02T13:23:37 or 42m)") flags.BoolVar(&opts.noColor, "no-color", false, "Produce monochrome output.") flags.BoolVar(&opts.noPrefix, "no-log-prefix", false, "Don't print prefix in logs.") flags.BoolVarP(&opts.timestamps, "timestamps", "t", false, "Show timestamps.") @@ -70,6 +72,7 @@ func runLogs(ctx context.Context, backend compose.Service, opts logsOptions, ser Services: services, Follow: opts.follow, Tail: opts.tail, + Since: opts.since, Timestamps: opts.timestamps, }) } diff --git a/local/compose/logs.go b/local/compose/logs.go index 3d0323fc5..759eccc60 100644 --- a/local/compose/logs.go +++ b/local/compose/logs.go @@ -48,6 +48,7 @@ func (s *composeService) Logs(ctx context.Context, projectName string, consumer ShowStdout: true, ShowStderr: true, Follow: options.Follow, + Since: options.Since, Tail: options.Tail, Timestamps: options.Timestamps, })