Access Kyma application logs
Get insights into your applications (microservices, Functions...) by viewing the respective logs.
To check out real-time logs immediately, use the Kubernetes functionalities - either with kubectl
, or in Kyma Dashboard.
If you want to see historical logs and use additional features, view the logs as aggregated by Loki. In Grafana, you can see a visual representation of your logs, while Loki itself provides an API for programmatic access.
Kubernetes logs in Kyma Dashboard
You can view real-time logs in Kyma Dashboard:
- Open Kyma Dashboard and select the Namespace.
- Access the Pod and select the container.
- Click View Logs.
Kubernetes logs using kubectl
Alternatively, to see real-time logs in your terminal, run the following command:
kubectl logs {POD_NAME} --namespace {NAMESPACE_NAME} --container {CONTAINER_NAME}
Loki logs in Grafana UI
NOTE: Loki is deprecated and is planned to be removed. If you want to install a custom Loki stack, take a look at Installing a custom Loki stack in Kyma.
NOTE: Prometheus and Grafana are deprecated and are planned to be removed. If you want to install a custom stack, take a look at Install a custom kube-prometheus-stack in Kyma.
To see a visual representation and search for specific logs, follow these steps:
- In the Cluster Overview of Kyma Dashboard, go to Observability and open Grafana.
- In Grafana's Explore section, select
Loki
as data source. Enter a query following the query language guidelines, for example:
Click to copy{namespace="kyma-system"} |= "info"
Loki logs using Loki API
NOTE: Loki is deprecated and is planned to be removed. If you want to install a custom Loki stack, take a look at Installing a custom Loki stack in Kyma.
To access the logs through the Loki API directly, follow these steps:
Configure port forwarding with the following command:
Click to copykubectl port-forward -n kyma-system service/logging-loki 3100:3100For example, to get the first 1000 lines of info logs for components in the
kyma-system
Namespace, run the following command:Click to copycurl -X GET -G 'http://localhost:3100/loki/api/v1/query' --data-urlencode 'query={namespace="kyma-system"}' --data-urlencode 'limit=1000' --data-urlencode 'regexp=info'