Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce ADR on structured logging #152

Merged
1 commit merged into from
May 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions docs/adr/002-use-structured-logging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
slug: 2
title: |
2. Use simple structured logging
authors: []
tags: [Draft]
---

## Status

**Draft**

## Context

* Logs are a critical tool for operating any software system, enabling [observability](https://cloud.google.com/architecture/devops/devops-measurement-monitoring-and-observability) of the system.
* Following [12 Factor Apps](https://12factor.net/logs) principles, providing the needed components and tools to be able to configure logging and monitoring should not be the responsibility of the software components

## Decision

_Therefore_

* Each component of the system use [Structured logging](https://www.sumologic.com/glossary/structured-logging/) using documented and standardised JSON format for its logs
* Logs are always emitted to `stdout` of the process the component is part of

## Consequences

* The schema of the logged items should be properly documented in a JSON schema
* It is the responsibility of the node operator to consume the logs and process them
* We use existing libraries to provide needed log infrastructure, like [slog](https://zsiciarz.github.io/24daysofrust/book/vol2/day4.html) for Rust