1podman-logs(1)()                                              podman-logs(1)()
2
3
4

NAME

6       podman-logs - Display the logs of one or more containers
7
8

SYNOPSIS

10       podman logs [options] container [container...]
11
12
13       podman container logs [options] container [container...]
14
15

DESCRIPTION

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. your run may
20       not have generated any logs at the time you execute podman logs).
21
22

OPTIONS

24       --follow, -f
25
26
27       Follow log output.  Default is false.
28
29
30       Note: If you are following a container which  is  removed  podman  con‐
31       tainer  rm  or  removed  on  exit  podman run --rm ..., then there is a
32       chance the the log file will be removed before podman  logs  reads  the
33       final content.
34
35
36       --latest, -l
37
38
39       Instead  of  providing  the  container name or ID, use the last created
40       container. If you use methods other than Podman to run containers  such
41       as  CRI-O,  the  last  started  container could be from either of those
42       methods.
43
44
45       The latest option is not supported on the remote client.
46
47
48       -n, --names
49
50
51       Output the container name in the log
52
53
54       --since=TIMESTAMP
55
56
57       Show logs since TIMESTAMP. The --since option can be  Unix  timestamps,
58       date  formatted  timestamps,  or  Go duration strings (e.g. 10m, 1h30m)
59       computed relative to the client machine's time. Supported  formats  for
60       date    formatted    time    stamps   include   RFC3339Nano,   RFC3339,
61       2006-01-02T15:04:05,  2006-01-02T15:04:05.999999999,  2006-01-02Z07:00,
62       and 2006-01-02.
63
64
65       --tail=LINES
66
67
68       Output  the  specified  number  of LINES at the end of the logs.  LINES
69       must be an integer.  Defaults to -1, which prints all lines
70
71
72       --timestamps, -t
73
74
75       Show timestamps in the log outputs.  The default is false
76
77

EXAMPLE

79       To view a container's logs:
80
81
82              podman logs -t b3f2436bdb978c1d33b1387afb5d7ba7e3243ed2ce908db431ac0069da86cb45
83
84              2017/08/07 10:16:21 Seeked /var/log/crio/pods/eb296bd56fab164d4d3cc46e5776b54414af3bf543d138746b25832c816b933b/c49f49788da14f776b7aa93fb97a2a71f9912f4e5a3e30397fca7dfe0ee0367b.log - {Offset:0 Whence:0}
85              1:C 07 Aug 14:10:09.055 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
86              1:C 07 Aug 14:10:09.055 # Redis version=4.0.1, bits=64, commit=00000000, modified=0, pid=1, just started
87              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
88              1:M 07 Aug 14:10:09.055 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
89              1:M 07 Aug 14:10:09.055 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
90              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'.
91              1:M 07 Aug 14:10:09.056 * Running mode=standalone, port=6379.
92              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.
93              1:M 07 Aug 14:10:09.056 # Server initialized
94
95
96
97       To view only the last two lines in container's log:
98
99
100              podman logs --tail 2 b3f2436bdb97
101
102              # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
103              # Server initialized
104
105
106
107       To view a containers logs since a certain time:
108
109
110              podman logs -t --since 2017-08-07T10:10:09.055837383-04:00 myserver
111
112              1:M 07 Aug 14:10:09.055 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
113              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'.
114              1:M 07 Aug 14:10:09.056 * Running mode=standalone, port=6379.
115              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.
116              1:M 07 Aug 14:10:09.056 # Server initialized
117
118
119
120       To view a container's logs generated in the last 10 minutes:
121
122
123              podman logs --since 10m myserver
124
125              # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
126              # 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'.
127
128
129

SEE ALSO

131       podman(1), podman-run(1), podman-container-rm(1)
132
133

HISTORY

135       February   2018,   Updated    by    Brent    Baude    bbaude@redhat.com
136       ⟨mailto:bbaude@redhat.com⟩
137
138
139       August   2017,  Originally  compiled  by  Ryan  Cole  rycole@redhat.com
140       ⟨mailto:rycole@redhat.com⟩
141
142
143
144                                                              podman-logs(1)()
Impressum