mirror of
https://github.com/containers/podman.git
synced 2025-05-21 00:56:36 +08:00
Man pages: refactor common options: log-related options
podman-logs and podman-pod-logs. Most of these were already identical, needing no review. Exceptions: --follow : needed some container/pod tweaking. This is the only one that really needs careful review. --names : I went with the longer version Note that podman-events has --since and --until options too, but those are too different to be combined here. Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
2
docs/source/markdown/.gitignore
vendored
2
docs/source/markdown/.gitignore
vendored
@ -9,11 +9,13 @@ podman-kill.1.md
|
|||||||
podman-kube-play.1.md
|
podman-kube-play.1.md
|
||||||
podman-login.1.md
|
podman-login.1.md
|
||||||
podman-logout.1.md
|
podman-logout.1.md
|
||||||
|
podman-logs.1.md
|
||||||
podman-manifest-add.1.md
|
podman-manifest-add.1.md
|
||||||
podman-manifest-push.1.md
|
podman-manifest-push.1.md
|
||||||
podman-pause.1.md
|
podman-pause.1.md
|
||||||
podman-pod-clone.1.md
|
podman-pod-clone.1.md
|
||||||
podman-pod-create.1.md
|
podman-pod-create.1.md
|
||||||
|
podman-pod-logs.1.md
|
||||||
podman-pod-rm.1.md
|
podman-pod-rm.1.md
|
||||||
podman-pod-start.1.md
|
podman-pod-start.1.md
|
||||||
podman-pod-stop.1.md
|
podman-pod-stop.1.md
|
||||||
|
3
docs/source/markdown/options/color.md
Normal file
3
docs/source/markdown/options/color.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#### **--color**
|
||||||
|
|
||||||
|
Output the containers with different colors in the log.
|
7
docs/source/markdown/options/follow.md
Normal file
7
docs/source/markdown/options/follow.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#### **--follow**, **-f**
|
||||||
|
|
||||||
|
Follow log output. Default is false.
|
||||||
|
|
||||||
|
Note: If you are following a <<container|pod>> which is removed by `podman <<container|pod>> rm`
|
||||||
|
or removed on exit (`podman run --rm ...`), then there is a chance that the log
|
||||||
|
file will be removed before `podman<< pod|>> logs` reads the final content.
|
3
docs/source/markdown/options/names.md
Normal file
3
docs/source/markdown/options/names.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#### **--names**, **-n**
|
||||||
|
|
||||||
|
Output the container names instead of the container IDs in the log.
|
6
docs/source/markdown/options/since.md
Normal file
6
docs/source/markdown/options/since.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#### **--since**=*TIMESTAMP*
|
||||||
|
|
||||||
|
Show logs since TIMESTAMP. The --since option can be Unix timestamps, date formatted timestamps, or Go duration
|
||||||
|
strings (e.g. 10m, 1h30m) computed relative to the client machine's time. Supported formats for date formatted
|
||||||
|
time stamps include RFC3339Nano, RFC3339, 2006-01-02T15:04:05, 2006-01-02T15:04:05.999999999, 2006-01-02Z07:00,
|
||||||
|
and 2006-01-02.
|
4
docs/source/markdown/options/tail.md
Normal file
4
docs/source/markdown/options/tail.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#### **--tail**=*LINES*
|
||||||
|
|
||||||
|
Output the specified number of LINES at the end of the logs. LINES must be an integer. Defaults to -1,
|
||||||
|
which prints all lines
|
3
docs/source/markdown/options/timestamps.md
Normal file
3
docs/source/markdown/options/timestamps.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#### **--timestamps**, **-t**
|
||||||
|
|
||||||
|
Show timestamps in the log outputs. The default is false
|
6
docs/source/markdown/options/until.md
Normal file
6
docs/source/markdown/options/until.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#### **--until**=*TIMESTAMP*
|
||||||
|
|
||||||
|
Show logs until TIMESTAMP. The --until option can be Unix timestamps, date formatted timestamps, or Go duration
|
||||||
|
strings (e.g. 10m, 1h30m) computed relative to the client machine's time. Supported formats for date formatted
|
||||||
|
time stamps include RFC3339Nano, RFC3339, 2006-01-02T15:04:05, 2006-01-02T15:04:05.999999999, 2006-01-02Z07:00,
|
||||||
|
and 2006-01-02.
|
@ -15,49 +15,24 @@ any logs at the time you execute podman logs).
|
|||||||
|
|
||||||
## OPTIONS
|
## OPTIONS
|
||||||
|
|
||||||
#### **--color**
|
@@option color
|
||||||
|
|
||||||
Output the containers with different colors in the log.
|
@@option follow
|
||||||
|
|
||||||
#### **--follow**, **-f**
|
|
||||||
|
|
||||||
Follow log output. Default is false.
|
|
||||||
|
|
||||||
Note: If you are following a container which is removed `podman container rm`
|
|
||||||
or removed on exit `podman run --rm ...`, then there is a chance that the log
|
|
||||||
file will be removed before `podman logs` reads the final content.
|
|
||||||
|
|
||||||
#### **--latest**, **-l**
|
#### **--latest**, **-l**
|
||||||
|
|
||||||
Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
|
Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
|
||||||
to run containers such as CRI-O, the last started container could be from either of those methods. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)
|
to run containers such as CRI-O, the last started container could be from either of those methods. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)
|
||||||
|
|
||||||
#### **--names**, **-n**
|
@@option names
|
||||||
|
|
||||||
Output the container name in the log
|
@@option since
|
||||||
|
|
||||||
#### **--since**=*TIMESTAMP*
|
@@option tail
|
||||||
|
|
||||||
Show logs since TIMESTAMP. The --since option can be Unix timestamps, date formatted timestamps, or Go duration
|
@@option timestamps
|
||||||
strings (e.g. 10m, 1h30m) computed relative to the client machine's time. Supported formats for date formatted
|
|
||||||
time stamps include RFC3339Nano, RFC3339, 2006-01-02T15:04:05, 2006-01-02T15:04:05.999999999, 2006-01-02Z07:00,
|
|
||||||
and 2006-01-02.
|
|
||||||
|
|
||||||
#### **--tail**=*LINES*
|
@@option until
|
||||||
|
|
||||||
Output the specified number of LINES at the end of the logs. LINES must be an integer. Defaults to -1,
|
|
||||||
which prints all lines
|
|
||||||
|
|
||||||
#### **--timestamps**, **-t**
|
|
||||||
|
|
||||||
Show timestamps in the log outputs. The default is false
|
|
||||||
|
|
||||||
#### **--until**=*TIMESTAMP*
|
|
||||||
|
|
||||||
Show logs until TIMESTAMP. The --until option can be Unix timestamps, date formatted timestamps, or Go duration
|
|
||||||
strings (e.g. 10m, 1h30m) computed relative to the client machine's time. Supported formats for date formatted
|
|
||||||
time stamps include RFC3339Nano, RFC3339, 2006-01-02T15:04:05, 2006-01-02T15:04:05.999999999, 2006-01-02Z07:00,
|
|
||||||
and 2006-01-02.
|
|
||||||
|
|
||||||
## EXAMPLE
|
## EXAMPLE
|
||||||
|
|
@ -13,51 +13,27 @@ Note: Long running command of `podman pod log` with a `-f` or `--follow` needs t
|
|||||||
|
|
||||||
## OPTIONS
|
## OPTIONS
|
||||||
|
|
||||||
#### **--color**
|
@@option color
|
||||||
|
|
||||||
Output the containers with different colors in the log.
|
|
||||||
|
|
||||||
#### **--container**, **-c**
|
#### **--container**, **-c**
|
||||||
|
|
||||||
By default `podman pod logs` retrieves logs for all the containers available within the pod differentiate by field `container`. However there are use-cases where user would want to limit the log stream only to a particular container of a pod for such cases `-c` can be used like `podman pod logs -c ctrNameorID podname`.
|
By default `podman pod logs` retrieves logs for all the containers available within the pod differentiate by field `container`. However there are use-cases where user would want to limit the log stream only to a particular container of a pod for such cases `-c` can be used like `podman pod logs -c ctrNameorID podname`.
|
||||||
|
|
||||||
#### **--follow**, **-f**
|
@@option follow
|
||||||
|
|
||||||
Follow log output. Default is false.
|
|
||||||
|
|
||||||
Note: If you are following a pod which is removed `podman pod rm`, then there is a
|
|
||||||
chance that the log file will be removed before `podman pod logs` reads the final content.
|
|
||||||
|
|
||||||
#### **--latest**, **-l**
|
#### **--latest**, **-l**
|
||||||
|
|
||||||
Instead of providing the pod name or id, get logs of the last created pod. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)
|
Instead of providing the pod name or id, get logs of the last created pod. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)
|
||||||
|
|
||||||
#### **--names**, **-n**
|
@@option names
|
||||||
|
|
||||||
Output the container names instead of the container IDs in the log.
|
@@option since
|
||||||
|
|
||||||
#### **--since**=*TIMESTAMP*
|
@@option tail
|
||||||
|
|
||||||
Show logs since TIMESTAMP. The --since option can be Unix timestamps, date formatted timestamps, or Go duration
|
@@option timestamps
|
||||||
strings (e.g. 10m, 1h30m) computed relative to the client machine's time. Supported formats for date formatted
|
|
||||||
time stamps include RFC3339Nano, RFC3339, 2006-01-02T15:04:05, 2006-01-02T15:04:05.999999999, 2006-01-02Z07:00,
|
|
||||||
and 2006-01-02.
|
|
||||||
|
|
||||||
#### **--tail**=*LINES*
|
@@option until
|
||||||
|
|
||||||
Output the specified number of LINES at the end of the logs. LINES must be an integer. Defaults to -1,
|
|
||||||
which prints all lines
|
|
||||||
|
|
||||||
#### **--timestamps**, **-t**
|
|
||||||
|
|
||||||
Show timestamps in the log outputs. The default is false
|
|
||||||
|
|
||||||
#### **--until**=*TIMESTAMP*
|
|
||||||
|
|
||||||
Show logs until TIMESTAMP. The --until option can be Unix timestamps, date formatted timestamps, or Go duration
|
|
||||||
strings (e.g. 10m, 1h30m) computed relative to the client machine's time. Supported formats for date formatted
|
|
||||||
time stamps include RFC3339Nano, RFC3339, 2006-01-02T15:04:05, 2006-01-02T15:04:05.999999999, 2006-01-02Z07:00,
|
|
||||||
and 2006-01-02.
|
|
||||||
|
|
||||||
## EXAMPLE
|
## EXAMPLE
|
||||||
|
|
Reference in New Issue
Block a user