Photo by Barrett Ward on Unsplash

Containers Logging Guide

Get Started with Containers Logging with Journald, Loki and Grafana

Mohammed Tayeh
2 min readOct 4, 2022

--

From a DevOps standpoint, logging is one of the most important things to get right in applications. Logging helps DevOps teams troubleshoot issues faster through the logging tools like ELK, Grafana, and Loki. this guide will explain how we send container logs to Journald and then push it to Loki with promtail and create a simple dashboard with Grafana.

I will use podman in this guide, the same commands and the same options are available on docker.

Podman Logging Driver with journald

There are several different log drivers you can use with the containers like json-file and journald. to get logging and info from the running containers.

let’s take Nginx container with access logs as example, on the podman run command i will add options --log-driver and --log-opt to specify the driver to be journald and the log file path to be access log.

you can pass the options to podman-compose like the below code

--

--

Mohammed Tayeh

Seasoned DevOps Engineer with diverse extensive background in cloud platforms. Highly motivated.