1podman-logs(1) General Commands Manual podman-logs(1)
2
3
4
6 podman-logs - Display the logs of one or more containers
7
8
10 podman logs [options] container [container...]
11
12
13 podman container logs [options] container [container...]
14
15
17 The podman logs command batch-retrieves whatever logs are present for
18 one or more containers at the time of execution. This does not guaran‐
19 tee execution order when combined with podman run (i.e. the run may not
20 have generated any logs at the time podman logs was executed).
21
22
24 --color
25 Output the containers with different colors in the log.
26
27
28 --follow, -f
29 Follow log output. Default is false.
30
31
32 Note: When following a container which is removed by podman container
33 rm or removed on exit (podman run --rm ...), there is a chance that the
34 log file is removed before podman logs reads the final content.
35
36
37 --latest, -l
38 Instead of providing the container name or ID, use the last created
39 container. Note: the last started container can be from other users of
40 Podman on the host machine. (This option is not available with the re‐
41 mote Podman client, including Mac and Windows (excluding WSL2) ma‐
42 chines)
43
44
45 --names, -n
46 Output the container names instead of the container IDs in the log.
47
48
49 --since=TIMESTAMP
50 Show logs since TIMESTAMP. The --since option can be Unix timestamps,
51 date formatted timestamps, or Go duration strings (e.g. 10m, 1h30m)
52 computed relative to the client machine's time. Supported formats for
53 date formatted time stamps include RFC3339Nano, RFC3339,
54 2006-01-02T15:04:05, 2006-01-02T15:04:05.999999999, 2006-01-02Z07:00,
55 and 2006-01-02.
56
57
58 --tail=LINES
59 Output the specified number of LINES at the end of the logs. LINES
60 must be an integer. Defaults to -1, which prints all lines
61
62
63 --timestamps, -t
64 Show timestamps in the log outputs. The default is false
65
66
67 --until=TIMESTAMP
68 Show logs until TIMESTAMP. The --until option can be Unix timestamps,
69 date formatted timestamps, or Go duration strings (e.g. 10m, 1h30m)
70 computed relative to the client machine's time. Supported formats for
71 date formatted time stamps include RFC3339Nano, RFC3339,
72 2006-01-02T15:04:05, 2006-01-02T15:04:05.999999999, 2006-01-02Z07:00,
73 and 2006-01-02.
74
75
77 To view a container's logs:
78
79
80 podman logs -t b3f2436bdb978c1d33b1387afb5d7ba7e3243ed2ce908db431ac0069da86cb45
81
82 2017/08/07 10:16:21 Seeked /var/log/crio/pods/eb296bd56fab164d4d3cc46e5776b54414af3bf543d138746b25832c816b933b/c49f49788da14f776b7aa93fb97a2a71f9912f4e5a3e30397fca7dfe0ee0367b.log - &{Offset:0 Whence:0}
83 1:C 07 Aug 14:10:09.055 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
84 1:C 07 Aug 14:10:09.055 # Redis version=4.0.1, bits=64, commit=00000000, modified=0, pid=1, just started
85 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
86 1:M 07 Aug 14:10:09.055 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
87 1:M 07 Aug 14:10:09.055 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
88 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'.
89 1:M 07 Aug 14:10:09.056 * Running mode=standalone, port=6379.
90 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.
91 1:M 07 Aug 14:10:09.056 # Server initialized
92
93
94
95 To view only the last two lines in container's log:
96
97
98 podman logs --tail 2 b3f2436bdb97
99
100 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
101 # Server initialized
102
103
104
105 To view all containers logs:
106
107
108 podman logs -t --since 0 myserver
109
110 1:M 07 Aug 14:10:09.055 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
111 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'.
112 1:M 07 Aug 14:10:09.056 * Running mode=standalone, port=6379.
113 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.
114 1:M 07 Aug 14:10:09.056 # Server initialized
115
116
117
118 To view a container's logs since a certain time:
119
120
121 podman logs -t --since 2017-08-07T10:10:09.055837383-04:00 myserver
122
123 1:M 07 Aug 14:10:09.055 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
124 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'.
125 1:M 07 Aug 14:10:09.056 * Running mode=standalone, port=6379.
126 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.
127 1:M 07 Aug 14:10:09.056 # Server initialized
128
129
130
131 To view a container's logs generated in the last 10 minutes:
132
133
134 podman logs --since 10m myserver
135
136 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
137 # 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.
138
139
140
141 To view a container's logs until 30 minutes ago:
142
143
144 podman logs --until 30m myserver
145
146 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
147 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
148 [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
149 [Tue Jul 20 13:18:14.223819 2021] [core:notice] [pid 1:tid 140021067187328] AH00094: Command line: 'httpd -D FOREGROUND'
150
151
152
154 podman(1), podman-run(1), podman-rm(1)
155
156
158 February 2018, Updated by Brent Baude bbaude@redhat.com
159 ⟨mailto:bbaude@redhat.com⟩
160
161
162 August 2017, Originally compiled by Ryan Cole rycole@redhat.com
163 ⟨mailto:rycole@redhat.com⟩
164
165
166
167 podman-logs(1)