1OC(1)                              June 2016                             OC(1)
2
3
4

NAME

6       oc logs - Print the logs for a resource
7
8
9

SYNOPSIS

11       oc logs [OPTIONS]
12
13
14

DESCRIPTION

16       Print the logs for a resource
17
18
19       Supported  resources are builds, build configs (bc), deployment configs
20       (dc), and pods. When a pod is specified and  has  more  than  one  con‐
21       tainer,  the  container  name  should be specified via -c. When a build
22       config or deployment config is specified, you can view the logs  for  a
23       particular version of it via --version.
24
25
26       If  your  pod  is  failing to start, you may need to use the --previous
27       option to see the logs of the last attempt.
28
29
30

OPTIONS

32       --all-containers=false
33           Get all containers's logs in the pod(s).
34
35
36       -c, --container=""
37           Print the logs of this container
38
39
40       -f, --follow=false
41           Specify if the logs should be streamed.
42
43
44       --limit-bytes=0
45           Maximum bytes of logs to return. Defaults to no limit.
46
47
48       --pod-running-timeout=0
49           The length of time (like 5s, 2m, or 3h, higher than zero)  to  wait
50       until at least one pod is running
51
52
53       -p, --previous=false
54           If  true, print the logs for the previous instance of the container
55       in a pod if it exists.
56
57
58       -l, --selector=""
59           Selector (label query) to filter on.
60
61
62       --since=0
63           Only return logs newer than a relative duration like 5s, 2m, or 3h.
64       Defaults to all logs. Only one of since-time / since may be used.
65
66
67       --since-time=""
68           Only  return  logs after a specific date (RFC3339). Defaults to all
69       logs. Only one of since-time / since may be used.
70
71
72       --tail=-1
73           Lines of recent log file to display. Defaults to -1 with no  selec‐
74       tor, showing all log lines otherwise 10, if a selector is provided.
75
76
77       --timestamps=false
78           Include timestamps on each line in the log output
79
80
81

OPTIONS INHERITED FROM PARENT COMMANDS

83       --allow_verification_with_non_compliant_keys=false
84           Allow  a  SignatureVerifier  to  use  keys  which  are  technically
85       non-compliant with RFC6962.
86
87
88       --alsologtostderr=false
89           log to standard error as well as files
90
91
92       --application_metrics_count_limit=100
93           Max number of application metrics to store (per container)
94
95
96       --as=""
97           Username to impersonate for the operation
98
99
100       --as-group=[]
101           Group to impersonate for the operation, this flag can  be  repeated
102       to specify multiple groups.
103
104
105       --azure-container-registry-config=""
106           Path  to the file containing Azure container registry configuration
107       information.
108
109
110       --boot_id_file="/proc/sys/kernel/random/boot_id"
111           Comma-separated list of files to check for boot-id. Use  the  first
112       one that exists.
113
114
115       --cache-dir="/builddir/.kube/http-cache"
116           Default HTTP cache directory
117
118
119       --certificate-authority=""
120           Path to a cert file for the certificate authority
121
122
123       --client-certificate=""
124           Path to a client certificate file for TLS
125
126
127       --client-key=""
128           Path to a client key file for TLS
129
130
131       --cloud-provider-gce-lb-src-cidrs=130.211.0.0/22,209.85.152.0/22,209.85.204.0/22,35.191.0.0/16
132           CIDRs opened in GCE firewall for LB traffic proxy  health checks
133
134
135       --cluster=""
136           The name of the kubeconfig cluster to use
137
138
139       --container_hints="/etc/cadvisor/container_hints.json"
140           location of the container hints file
141
142
143       --containerd="unix:///var/run/containerd.sock"
144           containerd endpoint
145
146
147       --context=""
148           The name of the kubeconfig context to use
149
150
151       --default-not-ready-toleration-seconds=300
152           Indicates   the   tolerationSeconds   of   the    toleration    for
153       notReady:NoExecute  that is added by default to every pod that does not
154       already have such a toleration.
155
156
157       --default-unreachable-toleration-seconds=300
158           Indicates the tolerationSeconds  of  the  toleration  for  unreach‐
159       able:NoExecute  that  is  added  by  default to every pod that does not
160       already have such a toleration.
161
162
163       --docker="unix:///var/run/docker.sock"
164           docker endpoint
165
166
167       --docker-tls=false
168           use TLS to connect to docker
169
170
171       --docker-tls-ca="ca.pem"
172           path to trusted CA
173
174
175       --docker-tls-cert="cert.pem"
176           path to client certificate
177
178
179       --docker-tls-key="key.pem"
180           path to private key
181
182
183       --docker_env_metadata_whitelist=""
184           a comma-separated list of environment variable keys that  needs  to
185       be collected for docker containers
186
187
188       --docker_only=false
189           Only report docker containers in addition to root stats
190
191
192       --docker_root="/var/lib/docker"
193           DEPRECATED:  docker  root is read from docker info (this is a fall‐
194       back, default: /var/lib/docker)
195
196
197       --enable_load_reader=false
198           Whether to enable cpu load reader
199
200
201       --event_storage_age_limit="default=24h"
202           Max length of time for which to store events (per type). Value is a
203       comma  separated  list  of  key  values, where the keys are event types
204       (e.g.: creation, oom) or "default" and the value is a duration. Default
205       is applied to all non-specified event types
206
207
208       --event_storage_event_limit="default=100000"
209           Max  number  of  events to store (per type). Value is a comma sepa‐
210       rated list of key values, where the keys are event  types  (e.g.:  cre‐
211       ation,  oom)  or  "default"  and  the  value  is an integer. Default is
212       applied to all non-specified event types
213
214
215       --global_housekeeping_interval=0
216           Interval between global housekeepings
217
218
219       --housekeeping_interval=0
220           Interval between container housekeepings
221
222
223       --httptest.serve=""
224           if non-empty, httptest.NewServer serves on this address and blocks
225
226
227       --insecure-skip-tls-verify=false
228           If true, the server's certificate will not be checked for validity.
229       This will make your HTTPS connections insecure
230
231
232       --kubeconfig=""
233           Path to the kubeconfig file to use for CLI requests.
234
235
236       --log-flush-frequency=0
237           Maximum number of seconds between log flushes
238
239
240       --log_backtrace_at=:0
241           when logging hits line file:N, emit a stack trace
242
243
244       --log_cadvisor_usage=false
245           Whether to log the usage of the cAdvisor container
246
247
248       --log_dir=""
249           If non-empty, write log files in this directory
250
251
252       --logtostderr=true
253           log to standard error instead of files
254
255
256       --machine_id_file="/etc/machine-id,/var/lib/dbus/machine-id"
257           Comma-separated  list  of  files  to  check for machine-id. Use the
258       first one that exists.
259
260
261       --match-server-version=false
262           Require server version to match client version
263
264
265       -n, --namespace=""
266           If present, the namespace scope for this CLI request
267
268
269       --request-timeout="0"
270           The length of time to wait before giving  up  on  a  single  server
271       request. Non-zero values should contain a corresponding time unit (e.g.
272       1s, 2m, 3h). A value of zero means don't timeout requests.
273
274
275       -s, --server=""
276           The address and port of the Kubernetes API server
277
278
279       --stderrthreshold=2
280           logs at or above this threshold go to stderr
281
282
283       --storage_driver_buffer_duration=0
284           Writes in the storage driver will be buffered  for  this  duration,
285       and committed to the non memory backends as a single transaction
286
287
288       --storage_driver_db="cadvisor"
289           database name
290
291
292       --storage_driver_host="localhost:8086"
293           database host:port
294
295
296       --storage_driver_password="root"
297           database password
298
299
300       --storage_driver_secure=false
301           use secure connection with database
302
303
304       --storage_driver_table="stats"
305           table name
306
307
308       --storage_driver_user="root"
309           database username
310
311
312       --token=""
313           Bearer token for authentication to the API server
314
315
316       --user=""
317           The name of the kubeconfig user to use
318
319
320       -v, --v=0
321           log level for V logs
322
323
324       --version=false
325           Print version information and quit
326
327
328       --vmodule=
329           comma-separated  list  of pattern=N settings for file-filtered log‐
330       ging
331
332
333

EXAMPLE

335                # Start streaming the logs of the most recent build of the openldap build config.
336                oc logs -f bc/openldap
337
338                # Start streaming the logs of the latest deployment of the mysql deployment config.
339                oc logs -f dc/mysql
340
341                # Get the logs of the first deployment for the mysql deployment config. Note that logs
342                # from older deployments may not exist either because the deployment was successful
343                # or due to deployment pruning or manual deletion of the deployment.
344                oc logs --version=1 dc/mysql
345
346                # Return a snapshot of ruby-container logs from pod backend.
347                oc logs backend -c ruby-container
348
349                # Start streaming of ruby-container logs from pod backend.
350                oc logs -f pod/backend -c ruby-container
351
352
353
354

SEE ALSO

356       oc(1),
357
358
359

HISTORY

361       June 2016, Ported from the Kubernetes man-doc generator
362
363
364
365Openshift                  Openshift CLI User Manuals                    OC(1)
Impressum