Skip to content
_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN DE
Let's talk

Log Aggregation in 10 Minutes

03. 11. 2025 1 min read intermediate

Logging to files on 10 servers? Here is a centralized solution in 10 minutes.

Stack: Loki + Promtail + Grafana

Loki is “Prometheus for logs” — lightweight, integrates with Grafana.

Docker Compose

services: loki: image: grafana/loki:latest ports: [“3100:3100”] promtail: image: grafana/promtail:latest volumes: - /var/log:/var/log - ./promtail.yml:/etc/promtail/config.yml grafana: image: grafana/grafana:latest ports: [“3000:3000”]

Promtail Config

server: { http_listen_port: 9080 } clients: [{ url: “http://loki:3100/loki/api/v1/push” }] scrape_configs: - job_name: system static_configs: - targets: [localhost] labels: { job: varlogs, __path__: /var/log/*.log }

Structured Logging

// JSON logs instead of plain text console.log(JSON.stringify({ level: “error”, msg: “request failed”, status: 500, path: “/api/users”, duration_ms: 1234 }));

Grafana Queries

{job=”varlogs”} |= “error” {job=”app”} | json | status >= 500

Tip

Log in structured format (JSON), tag environment and service. Set retention to 30 days.

logginglokidevops
Share:

CORE SYSTEMS team

We build core systems and AI agents that keep operations running. 15 years of experience with enterprise IT.