$ oc -n openshift-logging get route kibana
You can find the logs for Knative Serving services using the following procedure.
With OpenShift logging, the logs that your applications write to the console are collected in Elasticsearch. The following procedure outlines how to apply these capabilities to applications deployed by using Knative Serving.
Install the OpenShift CLI (oc
).
Get the Kibana route:
$ oc -n openshift-logging get route kibana
Use the route’s URL to navigate to the Kibana dashboard and log in.
Check that the index is set to .all. If the index is not set to .all, only the OpenShift system logs will be listed.
Filter the logs by using the knative-serving
namespace. Enter a filter for the service in the search box to filter results.
kubernetes.namespace_name:default AND kubernetes.labels.serving_knative_dev\/service:{service_name}
You can also filter by using /configuration
or /revision
.
Narrow your search by using kubernetes.container_name:<user_container>
to only display the logs generated by your application. Otherwise, you will see logs from the queue-proxy.
Use JSON-based structured logging in your application to allow for the quick filtering of these logs in production environments. |