Photo by Barrett Ward on Unsplash

Member-only story

Containers Logging Guide

Mohammed Tayeh
2 min readOct 4, 2022

--

Podman Logging Driver with journald

$ podman run -d --name nginx -p 8080:80 --log-driver journald --log-opt path=/var/log/nginx/access.log nginx
logging:
driver: journald
options:
LOG_PATH: /var/log/nginx/access.log
$ podman logs --tail 10 -f nginx$ journalctl CONTAINER_NAME=nginx

Collect logs with Promtail

scrape_configs:
- job_name: journal
journal:
max_age: 12h
json: false
labels:
job: journal
relabel_configs:
- source_labels: [__journal_container_name]
target_label: container

Grafana and Loki

--

--

Mohammed Tayeh
Mohammed Tayeh

Written by Mohammed Tayeh

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

No responses yet

Write a response