$ oc <options> --loglevel <log_level>
oc
) issues
oc
) log levelsWith 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 |
oc
) log levelsYou can investigate OpenShift CLI (oc
) issues by increasing the command’s log level.
Install the OpenShift CLI (oc
).
Specify the oc
log level when running an oc
command:
$ oc <options> --loglevel <log_level>
The OpenShift Container Platform user’s current session token is typically included in logged curl
requests where required. You can also obtain the current user’s session token manually, for use when testing aspects of an oc
command’s underlying process step by step:
$ oc whoami -t