OpenShift - View logs using the master-logs command
by
Jeremy Canfield |
Updated: October 20 2021
| OpenShift articles
The master-logs command can be used to view logs, like this.
/usr/local/bin/master-logs api api
I0622 22:53:09.168927 1 controller.go:105] OpenAPI AggregationController: Processing item v1beta1.servicecatalog.k8s.io
E0622 22:53:09.173652 1 controller.go:111] loading OpenAPI spec for "v1beta1.servicecatalog.k8s.io" failed with: OpenAPI spec does not exists
I0622 22:53:09.173671 1 controller.go:119] OpenAPI AggregationController: action for item v1beta1.servicecatalog.k8s.io: Rate Limited Requeue.
I0622 22:53:11.474245 1 logs.go:49] http: TLS handshake error from 10.44.128.80:47384: EOF
I0622 22:53:13.459375 1 logs.go:49] http: TLS handshake error from 10.44.128.81:39654: EOF
Use 2> to redirect the master-logs to a file.
/usr/local/bin/master-logs api api 2> master.log
The following files will contain the log level based on the role. Use the oc get nodes command to determine the role of the node.
# master role
/etc/origin/master/master.env
# non-master role
/etc/sysconfig/atomic-openshift-node
By default, the file will contain a line like this. The higher the log level, the more events will be written to the logs.
DEBUG_LOGLEVEL=2
If you change the log level, the node will need to be restarted for the change to take effect.
Did you find this article helpful?
If so, consider buying me a coffee over at