Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmd/compose/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"errors"

"github.com/docker/cli-docs-tool/annotation"
"github.com/docker/cli/cli/command"
"github.com/spf13/cobra"

Expand Down Expand Up @@ -63,7 +64,9 @@ func logsCommand(p *ProjectOptions, dockerCli command.Cli, backendOptions *Backe
flags.BoolVarP(&opts.follow, "follow", "f", false, "Follow log output")
flags.IntVar(&opts.index, "index", 0, "index of the container if service has multiple replicas")
flags.StringVar(&opts.since, "since", "", "Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)")
flags.SetAnnotation("since", annotation.ExternalURL, []string{"https://docs.docker.com/reference/cli/docker/container/logs/"}) //nolint:errcheck
flags.StringVar(&opts.until, "until", "", "Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)")
flags.SetAnnotation("until", annotation.ExternalURL, []string{"https://docs.docker.com/reference/cli/docker/container/logs/#until"}) //nolint:errcheck
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")
Expand Down
22 changes: 11 additions & 11 deletions docs/reference/compose_logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ Displays log output from services

### Options

| Name | Type | Default | Description |
|:---------------------|:---------|:--------|:-----------------------------------------------------------------------------------------------|
| `--dry-run` | `bool` | | Execute command in dry run mode |
| `-f`, `--follow` | `bool` | | Follow log output |
| `--index` | `int` | `0` | index of the container if service has multiple replicas |
| `--no-color` | `bool` | | Produce monochrome output |
| `--no-log-prefix` | `bool` | | Don't print prefix in logs |
| `--since` | `string` | | Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) |
| `-n`, `--tail` | `string` | `all` | Number of lines to show from the end of the logs for each container |
| `-t`, `--timestamps` | `bool` | | Show timestamps |
| `--until` | `string` | | Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) |
| Name | Type | Default | Description |
|:--------------------------------------------------------------------------------|:---------|:--------|:-----------------------------------------------------------------------------------------------|
| `--dry-run` | `bool` | | Execute command in dry run mode |
| `-f`, `--follow` | `bool` | | Follow log output |
| `--index` | `int` | `0` | index of the container if service has multiple replicas |
| `--no-color` | `bool` | | Produce monochrome output |
| `--no-log-prefix` | `bool` | | Don't print prefix in logs |
| [`--since`](https://docs.docker.com/reference/cli/docker/container/logs/) | `string` | | Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) |
| `-n`, `--tail` | `string` | `all` | Number of lines to show from the end of the logs for each container |
| `-t`, `--timestamps` | `bool` | | Show timestamps |
| [`--until`](https://docs.docker.com/reference/cli/docker/container/logs/#until) | `string` | | Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) |


<!---MARKER_GEN_END-->
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/docker_compose_logs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ options:
value_type: string
description: |
Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
details_url: /reference/cli/docker/container/logs/
deprecated: false
hidden: false
experimental: false
Expand Down Expand Up @@ -83,6 +84,7 @@ options:
value_type: string
description: |
Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
details_url: /reference/cli/docker/container/logs/#until
deprecated: false
hidden: false
experimental: false
Expand Down
Loading