Skip to content

Docker logging options

See also ../kubernetes/logging.md for kubernetes logging options, including loki.

https://docs.docker.com/config/containers/logging/configure/

Options to consider which come integrated with docker

  • journald: Log to systemd-journald. rsyslog can be configured to log journal msgs to a remote systlog server without blocking docker containers from starting.
  • syslog Log directly to a remote syslog server. Downside: Remote server must be up otherwise no container will start:
Failed to start container ...: failed to initialize logging driver: dial tcp 10.27.192.52:1514: connect: connection refused

fluentd

https://docs.fluentd.org/how-to-guides

Logstash

integrates in the ELK stash (Elasticsearch, Logstash and Kibana)

Greylog

Graylog is a powerful, free, open-source log management and analysis tool that can be used for monitoring SSH logins and unusual activity to debugging applications. It is based on Java, Elasticsearch, and MongoDB and provides a beautiful web interface for centralized log management and log analysis.

These instructions configure rsyslog and syslog-ng to send log messages unencrypted over the network. This is generally not recommended on public networks.

Not integrated natively

Loki

A lightweight approach when you already have grafana installed.

The recommended way of using loki with plain docker is the loki docker-driver. The docker-driver also has support for non-containerized application logs which log directly to systemd.

??? Unfortunatly the loki docker-driver is not available for arm (Raspi). ??? (Really ???)

There's also the Loki docker usage, however it looks like you don't get service discovery with this approach. There's also this approach: https://github.com/swarmstack/loki/tree.

Promtail

Promtail will not start when running in docker on a Raspberry Pi

Clients authentication

Using the loku-url like this:

`loki-url: "https://<user_id>:<password>@logs-us-west1.grafana.net/loki/api/v1/push"`