Skip to content

Logging

Michael-Mezzacappa edited this page Nov 11, 2025 · 5 revisions

Logging Stack

Grafana: Grafana is an open source visualization platform that allows developers to analyze logs. In order to see your progams logs in Grafana you are able to create dashboards which allow filtering by date and time, or by specific tags you applied to the logs. It also supports many different data sources such as AWS Cloudwatch which is what is used in production, and Loki which is used for development by the velosim team.

Loki: Loki is a log aggregator, meaning it efficiently stores and makes the collected logs queryable by the Grafana dashboard.

Promtail: Promtail is what is used in our application to scrape the logs written to logs.txt, then sending it to loki to be stored.

AWS Cloudwatch: We are using AWS Cloudwatch in production to store logs on the cloud in order for all team members to easily be able to see them without needing to run the containers holding our logging tech stack.

A significant amount of detail is logged automatically:

  • API requests and response codes (but not including the requesting user)
  • Startup/shutdown of the application
  • Error traces which are logged to the console

Grafana queries can be used to interpret the logs.

Logging Library

At the moment we use Loki and promtail to produce more detailed logs from our app. Change are possible in the future if we see a better solution for these

This includes logs at the ERROR, INFO and WARNING levels from our application code, documenting significant events which occur in the apps.

This library can also collect metrics: for example, counts of significant events, or average response times.

Frontend Logs

We provide an endpoint /logs/frontend which the front-end can use to persist significant events that occur in the front-end to the back-end logs, allowing for a holistic analysis of the user's journey through the application.

Clone this wiki locally