From 7ce96255fdfeb5d8dfda76b3cc895bd6824f5050 Mon Sep 17 00:00:00 2001 From: Drew Erny Date: Wed, 1 Mar 2017 16:37:25 -0800 Subject: [PATCH] Add tail and since to service logs This change adds the ability to do --tail and --since on docker service logs. It wires up the API endpoints to each other and fixes some older bugs. It adds integration tests for these new features. Signed-off-by: Drew Erny --- command/service/logs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command/service/logs.go b/command/service/logs.go index 19d3d9a488..40e7bd41fd 100644 --- a/command/service/logs.go +++ b/command/service/logs.go @@ -45,7 +45,7 @@ func newLogsCommand(dockerCli *command.DockerCli) *cobra.Command { flags := cmd.Flags() flags.BoolVar(&opts.noResolve, "no-resolve", false, "Do not map IDs to Names") flags.BoolVarP(&opts.follow, "follow", "f", false, "Follow log output") - flags.StringVar(&opts.since, "since", "", "Show logs since timestamp") + flags.StringVar(&opts.since, "since", "", "Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)") flags.BoolVarP(&opts.timestamps, "timestamps", "t", false, "Show timestamps") flags.BoolVar(&opts.details, "details", false, "Show extra details provided to logs") flags.StringVar(&opts.tail, "tail", "all", "Number of lines to show from the end of the logs")