This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.5.8. Diagnosing OpenShift CLI (oc) issues
5.8.1. Understanding OpenShift CLI (oc) log levels 复制链接链接已复制到粘贴板!
With the OpenShift CLI (oc), you can create applications and manage OpenShift Container Platform projects from a terminal.
If oc command-specific issues arise, increase the oc log level to output API request, API response, and curl request details generated by the command. This provides a granular view of a particular oc command’s underlying operation, which in turn might provide insight into the nature of a failure.
oc log levels range from 1 to 10. The following table provides a list of oc log levels, along with their descriptions.
| Log level | Description |
|---|---|
| 1 to 5 | No additional logging to stderr. |
| 6 | Log API requests to stderr. |
| 7 | Log API requests and headers to stderr. |
| 8 | Log API requests, headers, and body, plus API response headers and body to stderr. |
| 9 |
Log API requests, headers, and body, API response headers and body, plus |
| 10 |
Log API requests, headers, and body, API response headers and body, plus |
5.8.2. Specifying OpenShift CLI (oc) log levels 复制链接链接已复制到粘贴板!
You can investigate OpenShift CLI (oc) issues by increasing the command’s log level.
Prerequisites
-
You have installed the OpenShift CLI (
oc).
Procedure
Specify the
oclog level when running anoccommand:oc <options> --loglevel <log_level>
$ oc <options> --loglevel <log_level>Copy to Clipboard Copied! Toggle word wrap Toggle overflow The OpenShift Container Platform user’s current session token is typically included in logged
curlrequests where required. You can also obtain the current user’s session token manually, for use when testing aspects of anoccommand’s underlying process step by step:oc whoami -t
$ oc whoami -tCopy to Clipboard Copied! Toggle word wrap Toggle overflow