Skip to main content


🕓 10 minutes

What you’ll learn​

How to use logs of your application for monitoring, debugging, and better understanding of the process behind the code.

Logging helps you to:

  • follow the system actions and information about user,
  • and reveal application problems together with the place where they occur.



Loki tool​

CodeNow is using the Loki tool for logs, which is a horizontally scalable log aggregation system.

  • Loki comes with its own language for queries called LogQL.
  • LogQL uses labels and operators for filtering.


  1. Find the "Logging&Tracing" section in the sidebar menu and go to the "Logging" option.


  1. You have different options to enter a query:
  • You can use "Log browser" button to automatically generate a query:
    • Select some labels and then select values for each of these labels.
    • Tool will automatically generate the query, which you can see as "Resulting selector" at the bottom of log browser.
    • Press "Show logs" button.

  • You can write your own queries from basic queries and then click on the "Run Query" button.:
    • Logs for your namespace: {namespace="_name_of_the_namespace_"}
    • Logs for the specific application: {app="_name_of_the_application_", namespace="_name_of_the_namespace_"}
    • NOTE: You can't use traceID for application logs.

  • To understand how to write more complex queries, please refer to LogQL's online documentation.

  • To understand how to write queries for the Loki tool, please refer to "Loki Cheat Sheet".


  1. The appeared graph shows you the request statistics in time. Below it you will find application logs.
  • You can also set the appearance of the logs: time, unique labels, wrap lines or dedup. You can additionally flip the results' order.

  1. You can expand the log to see more details
  • You can click on "Jaeger" button to see the corresponding trace


  1. You can set the time range for your application and see the corresponding logs.

  1. For live monitoring of your application, click on the "Live" button.
    • For pausing or stopping the live monitoring, simply click on the "Live" button again.

  1. If you want to add another query and run both the original query and the new query at the same time, you can click on the "Add query" button.
    • You can simply disable or remove a query by clicking on buttons in the right side of the query


  1. You can split your screen in two by clicking on the "split" sign.

  1. Here we described the basics of using Logging in Grafana. For more details visit the corresponding section of Grafana's online documentation.