podman-logs(1)

πŸ“¦
version 6.1.4 Β· 5 versions
, in alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu resolute, ubuntu stonking

✨ podman-logs ✨ β€” Display the logs of one or more containers πŸ’…

okay bestie, welcome to the General Commands Manual section for podman-logs 🫢 this is the page where your containers spill ALL the tea about what they've been up to, and we're gonna read every word. no cap.


πŸ“– SYNOPSIS

podman logs [options] container [container...]

podman container logs [options] container [container...]

🌸 DESCRIPTION

The podman logs command batch-retrieves whatever logs are present for one or more containers at the time of execution. Periodt. πŸŽ€

but like… it does not guarantee execution order when you combine it with podman run β€” meaning the run might not have generated any logs yet at the exact moment podman logs ran. so yeah, timing is giving chaotic energy sometimes 😭 that's just how it is.


✨ OPTIONS ✨

  • --color β€” outputs the containers with different colors in the log 🌈 cute AND functional, we love a multicolor moment.
  • --follow, -f β€” follows the log output, live and unhinged. default is false.
πŸ‘€ note, bestie: when you're following a container that gets removed by podman container rm, or that's set to be removed on exit (podman run --rm ...), there's a chance the log file gets yeeted before podman logs reads the final content. so the last lil bit might ghost you. sad but true πŸ’€
  • --latest, -l β€” instead of handing over a container name or ID, it just uses the last created container.
πŸ™ˆ note: that last started container can belong to other users of Podman on the host machine, so like… be aware. (this option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)
  • --names, -n β€” outputs the container names instead of the container IDs in the log. name-drop era πŸ‘‘
  • --since=TIMESTAMP β€” shows 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. yes, all of them. she's flexible like that πŸ’…
  • --tail=LINES β€” outputs the specified number of LINES at the end of the logs. LINES must be an integer. defaults to -1, which prints all lines. the whole thing. the entire saga πŸ“œ
  • --timestamps, -t β€” shows timestamps in the log outputs. the default is false. πŸ•
  • --until=TIMESTAMP β€” shows 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. same energy as --since, just the other direction πŸ¦‹

πŸ’– EXAMPLE

to view a container's logs:

podman logs -t b3f2436bdb978c1d33b1387afb5d7ba7e3243ed2ce908db431ac0069da86cb45

2017/08/07 10:16:21 Seeked /var/log/crio/pods/eb296bd56fab164d4d3cc46e5776b54414af3bf543d138746b25832c816b933b/c49f49788da14f776b7aa93fb97a2a71f9912f4e5a3e30397fca7dfe0ee0367b.log - &{Offset:0 Whence:0}
1:C 07 Aug 14:10:09.055 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 07 Aug 14:10:09.055 # Redis version=4.0.1, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 07 Aug 14:10:09.055 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 07 Aug 14:10:09.055 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
1:M 07 Aug 14:10:09.055 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
1:M 07 Aug 14:10:09.055 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
1:M 07 Aug 14:10:09.056 * Running mode=standalone, port=6379.
1:M 07 Aug 14:10:09.056 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 07 Aug 14:10:09.056 # Server initialized

to view only the last two lines in container's log:

podman logs --tail 2 b3f2436bdb97

# WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
# Server initialized

to view all containers logs:

podman logs -t --since 0 myserver

1:M 07 Aug 14:10:09.055 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
1:M 07 Aug 14:10:09.055 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
1:M 07 Aug 14:10:09.056 * Running mode=standalone, port=6379.
1:M 07 Aug 14:10:09.056 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 07 Aug 14:10:09.056 # Server initialized

to view a container's logs since a certain time:

podman logs -t --since 2017-08-07T10:10:09.055837383-04:00 myserver

1:M 07 Aug 14:10:09.055 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
1:M 07 Aug 14:10:09.055 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
1:M 07 Aug 14:10:09.056 * Running mode=standalone, port=6379.
1:M 07 Aug 14:10:09.056 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 07 Aug 14:10:09.056 # Server initialized

to view a container's logs generated in the last 10 minutes:

podman logs --since 10m myserver

# Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
# Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit, Increase 'ulimit -n' when higher maxclients are required.

to view a container's logs until 30 minutes ago:

podman logs --until 30m myserver

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.0.2.100. Set the 'ServerName' directive globally to suppress this message
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.0.2.100. Set the 'ServerName' directive globally to suppress this message
[Tue Jul 20 13:18:14.223727 2021] [mpm_event:notice] [pid 1:tid 140021067187328] AH00489: Apache/2.4.48 (Unix) configured -- resuming normal operations
[Tue Jul 20 13:18:14.223819 2021] [core:notice] [pid 1:tid 140021067187328] AH00094: Command line: 'httpd -D FOREGROUND'

πŸ‘€ SEE ALSO

podman(1), podman-run(1), podman-rm(1)


πŸ“œ HISTORY

February 2018, Updated by Brent Baude bbaude@redhat.com ⟨mailto:bbaude@redhat.com⟩

August 2017, Originally compiled by Ryan Cole rycole@redhat.com ⟨mailto:rycole@redhat.com⟩


and that's the whole page, bestie 🫢 this one lives in the General Commands Manual, filed under podman-logs(1), and it's giving iconic documentation energy from start to finish. go read those logs. slay. πŸ’…βœ¨πŸŒˆ

πŸ“¦ where this page comes from