Engineering

What Is Centralized Logging? A Complete Guide

Learn what centralized logging is, why it matters, how to implement it, and which tools to use. Covers architecture, protocols, and practical setup.

LogFlow TeamAugust 28, 202611 min read

When your application runs on one server, you SSH in and read the log file. When it runs on 20 containers across 3 services, that approach falls apart. Centralized logging solves this by collecting all logs into a single, searchable system.

What Is Centralized Logging?

Centralized logging is the practice of shipping logs from every source — application servers, containers, databases, load balancers, cloud functions — to a single platform where they can be searched, filtered, and analyzed together.

Instead of this:

ssh server-1 → tail -f /var/log/app.log
ssh server-2 → grep "error" /var/log/app.log
ssh server-3 → cat /var/log/app.log | grep "user-123"

You get this:

level:error service:api user_id:123 → 14 results in 8ms

Every log, from every source, in one search. That's the core value.

Why You Need Centralized Logging

1. Servers Are Ephemeral

Containers restart. Kubernetes pods get rescheduled. Lambda functions spin up and down. When the container dies, its logs die with it — unless you shipped them somewhere first.

2. Multi-Service Debugging

A user reports a 500 error. The request touched your API gateway, auth service, payment service, and notification service. Without centralized logging, you'd need to SSH into four machines and manually correlate timestamps. With it, you search by trace ID and see the full request path in one view.

3. Alerting and Monitoring

You can't set up "alert me when error rate exceeds 5%" if your logs are scattered across servers. Centralized logging enables threshold-based alerts, anomaly detection, and dashboards — all from the same data.

4. Compliance and Audit

Many industries require log retention for 30, 90, or 365 days. A centralized system with configurable retention policies handles this automatically.

Architecture: How It Works

A centralized logging system has three components:

1. Collection (Shipping)

Logs need to get from the source to the central system. There are three approaches:

Direct SDK integration — Your application sends logs directly via HTTP:

import { LogFlow } from '@getlogflow/js'

const logger = new LogFlow({
  apiKey: process.env.LOGFLOW_API_KEY,
  service: 'api',
})

logger.info('request.handled', { path: '/api/users', status: 200 })

This is the simplest approach and works well for applications you control. See the quick start guide for setup.

Log shippers — Agents like Fluentd, Fluent Bit, Vector, or Filebeat read log files and forward them:

# Fluent Bit config — read Docker logs, forward to LogFlow
[INPUT]
    Name  tail
    Path  /var/log/containers/*.log

[OUTPUT]
    Name  http
    Match *
    Host  api.getlogflow.com
    Port  443
    URI   /v1/logs
    Header Authorization Bearer lf_your_api_key
    Format json
    tls   On

Log shippers are ideal for infrastructure you don't control (databases, load balancers, third-party services).

OpenTelemetry — The vendor-neutral standard for telemetry. The OTel Collector receives logs, metrics, and traces and forwards them to any backend. See our OpenTelemetry guide.

2. Storage and Indexing

The central system needs to store logs efficiently and make them searchable. The two dominant storage engines:

Engine Strengths Weaknesses
Elasticsearch Mature ecosystem, full-text search JVM memory hungry, complex to operate, expensive at scale
ClickHouse Column-oriented, fast aggregations, 10x compression Newer ecosystem, fewer integrations

LogFlow uses ClickHouse, which delivers sub-12ms search times at a fraction of the storage cost. For a deeper comparison, see ClickHouse vs Elasticsearch for logs.

3. Analysis and Visualization

Once logs are centralized, you need tools to make sense of them:

  • Search — full-text and structured queries across all services
  • Live tail — real-time log streaming filtered by service or level
  • Dashboards — error rates, volume trends, top errors by service
  • Alerts — threshold breaches, keyword matches, anomaly detection
  • Error grouping — similar errors collected into Issues for tracking

Structured vs Unstructured Logs

Centralized logging works best with structured (JSON) logs:

{"timestamp": "2026-08-28T14:23:11Z", "level": "error", "service": "api", "message": "payment.failed", "user_id": 42, "error": "card_declined", "amount": 99.00}

Unstructured logs require parsing rules (regex, grok patterns) to extract fields. This is fragile and slow. If you control the application, always log structured JSON.

How to Choose a Centralized Logging Tool

Self-hosted options

  • ELK Stack (Elasticsearch + Logstash + Kibana) — the classic choice. Powerful but requires significant ops effort: JVM tuning, shard management, index lifecycle policies. Budget 10-20 hours/month for maintenance. See ELK stack alternatives.
  • Grafana Loki — log aggregation with Grafana. Cheaper storage but limited query capabilities compared to full-text search engines. See LogFlow vs Grafana Loki.
  • ClickHouse + custom UI — fast and cheap storage, but you build everything yourself.

Managed options

  • Datadog — full observability platform. Excellent but expensive ($0.10/GB/day ingestion + $15/host/month). See LogFlow vs Datadog.
  • Splunk — enterprise-grade, priced accordingly (~$2/GB/month). See LogFlow vs Splunk.
  • LogFlow — ClickHouse-powered, flat pricing from $0 (free tier) to $149/month. Search, alerts, error grouping, anomaly detection included. Try the pricing calculator.
  • New Relic — 100 GB free, $0.30/GB after + $99/user. See LogFlow vs New Relic.

Getting Started

The fastest path to centralized logging:

  1. Sign up for LogFlow — free tier, no credit card
  2. Install the SDK — npm, pip, or HTTP API
  3. Send a log — one line of code
  4. Set up alerts — get notified in Slack when errors spike

From zero to centralized logging in under 5 minutes.

Related Reading

Start monitoring your logs today

Free plan available. No credit card required. Up and running in 2 minutes.

Get started free