Logs in a distributed system are scattered across services and infrastructure. A single request can leave lines in an ingress controller, three microservices, a sidecar, and a managed database. Those records end up in different locations, and some can disappear when Kubernetes pods are removed or their logs rotate. Investigating one failed request means searching across services and trying to reconstruct what happened.
Log centralization brings those records together so you can investigate failures without searching multiple systems. It also helps you preserve logs, correlate events, and manage access and retention. This article covers how centralized logging works, how to implement it, the architectural and cost considerations, and how groundcover combines Kubernetes logs with metrics and traces.
What Is Log Centralization?
Log centralization makes logs from applications, containers, servers, and cloud services accessible through a shared interface for searching and analysis. Without it, you need to inspect files on individual Kubernetes nodes, query separate cloud accounts, or connect to multiple servers to investigate one incident. Centralized access doesn’t require storing every log in the same system.
There are two main approaches:
-
Physical consolidation: Agents or replication pipelines send logs into a shared backend, such as ClickHouse, Elasticsearch, or Loki. The backend stores and retains those records independently of the systems that produced them. -
Federated querying: A shared query layer accesses logs in their existing stores without moving the records. Retention remains with the original sources. If a source becomes unavailable, queries can fail or return incomplete results, depending on the configuration.
In Kubernetes, node-local container logs are subject to rotation and can disappear when pods are removed. To preserve logs after pods or nodes disappear, you need storage with a lifecycle independent of nodes, pods, and containers. Kubernetes doesn’t provide a native backend for that storage (Kubernetes).
Benefits of Centralized Logging
Centralized logging reduces the time you spend locating records across services and systems when investigating an incident. Instead of searching individual pods, servers, and cloud consoles, you can examine related events through a shared interface. The benefits extend to troubleshooting, security monitoring, and audit requirements.
-
Faster incident investigation: You can compare errors from an ingress controller, application, and dependent services to identify where a request failed. Searching related events together reduces the time spent gathering evidence and can shorten mean time to resolution (MTTR). -
Correlation across services: Consistent timestamps, service names, and request identifiers help you connect events across microservices. When logs contain trace IDs, you can link them to their corresponding traces to follow requests across services (OpenTelemetry). -
Visibility across ephemeral workloads: Kubernetes pods can be evicted, and nodes can be replaced or removed. Forwarding logs to independent storage before they’re rotated or deleted keeps those records available after the original workloads disappear (Kubernetes). -
Centralized security monitoring: Bringing authentication, network, and application logs into a common search interface helps you investigate suspicious activity across systems. You can also configure alerts for patterns such as repeated failed logins or unexpected privileged actions. -
Audit trails and retention: Centralized storage lets you apply retention policies and control access to historical records. With appropriate permissions and integrity protections, you can preserve logs for security reviews, compliance audits, and investigations (log retention policies).
These benefits depend on collecting records before they disappear, preserving useful metadata, and configuring the backend to retain the data you need.
How a Centralized Logging Pipeline Works
A centralized logging pipeline collects records from applications and infrastructure, processes them into a consistent format, and forwards them to a backend for storage and querying. The pipeline normally has five stages, each responsible for a different part of the process.
Collection. On Kubernetes, applications typically write logs to stdout and stderr, which the container runtime stores in files under /var/log/pods. A node-level collector running as a DaemonSet reads those records and forwards them to the logging backend. Logs from virtual machines, managed services, and other environments can arrive through system journal collectors, APIs, or integrations.
The kubelet rotates container logs when they reach containerLogMaxSize (10 MiB by default) and retains up to containerLogMaxFiles (five by default). The kubectl logs command exposes only the latest log file. If a collector falls behind and older files are rotated away, those records can be lost (Kubernetes).
Processing. Before forwarding, collectors parse log messages, normalize fields such as timestamps and severity, and enrich records with context such as Kubernetes namespaces, pods, and service names. They can also filter unnecessary records and mask sensitive values. The next subsection covers these operations in more detail.
Forwarding and buffering. Collectors send processed logs to the backend, often in batches. Memory queues absorb short interruptions, while disk-backed buffers can preserve pending records across collector restarts. For larger pipelines, a streaming system such as Kafka can separate collection from backend ingestion and allow records to be replayed during recovery.
Buffers have capacity and retention limits, so they don’t guarantee lossless delivery. Delivery semantics also depend on the configuration: at-least-once delivery can produce duplicate records during retries, which downstream systems may need to handle.
Storage and indexing. Once records reach the backend, they’re stored according to its retention policy and organized for searching. Some systems index labels to locate relevant log streams, others use full-text indexes, and columnar databases such as ClickHouse organize data to support filtering and aggregation. The indexing approach affects storage consumption, search performance, and which queries run efficiently.
Querying and alerting. A shared search interface lets you filter records by time, severity, service, namespace, or other collected attributes. You can compare related events, identify recurring errors, and configure alerts when specified conditions occur. When logs include trace IDs, those identifiers can also connect log entries to the corresponding distributed traces.
Failure handling and monitoring. A collector must account for backend outages and ingestion slowdowns. Fluent Bit can pause inputs when memory buffers reach their limits, but some sources may lose data while paused. Filesystem buffering provides more capacity and can preserve pending records across restarts (Fluent Bit).
The OpenTelemetry Collector supports sending queues, retry policies, and persistent queues through the file_storage extension. Its standard exporter retry configuration has a maximum elapsed time of 300 seconds, so longer outages require appropriate configuration to reduce data loss (OpenTelemetry).
Monitor queue utilization, enqueue failures, and dropped records. For the OpenTelemetry Collector, otelcol_exporter_queue_size, otelcol_exporter_queue_capacity, and otelcol_exporter_enqueue_failed_log_records help identify delivery problems before missing logs disrupt an investigation.
Log Normalization, Enrichment, and Filtering
Logs arrive in different formats, from plain-text messages to structured application events. Structured logging records fields such as severity and service name at the source. Normalization makes those fields consistent so you can search across services without separate queries for each log format. JSON is common, but it isn’t required for centralized logging.
The OpenTelemetry Logs Data Model defines common fields for this purpose:
-
Timestamps:Timestamprecords when the event occurred, whileObservedTimestamprecords when the collection system observed it. -
Severity and message:SeverityNumberrepresents log severity numerically, whileBodycontains the log message or structured event content. -
Resource and attributes:Resourceidentifies the source of the log, while attributes provide additional event context. -
Trace context:TraceIdandSpanIdlink logs to distributed traces when those identifiers are available.
Kubernetes metadata enrichment. Container logs don’t always identify the deployment or namespace that produced them. The OpenTelemetry Collector’s k8sattributes processor can attach attributes such as k8s.namespace.name, k8s.pod.name, k8s.deployment.name, and k8s.node.name by associating incoming telemetry with Kubernetes resources.
Without custom pod-association rules, the processor uses the connection IP address for pod matching. For container-specific enrichment in pods with multiple containers, incoming resource attributes need container.id or k8s.container.name to identify the correct container (OpenTelemetry Collector).
Filtering and masking. Filtering removes records you don’t need, such as high-volume debug logs, before they’re forwarded. A drop filter removes the entire matching record; it doesn’t hide the matching text. Masking instead removes or replaces sensitive values, such as credentials or personal information, while preserving the rest of the record.
Apply filtering and masking as early as your collection architecture allows. This reduces unnecessary ingestion and prevents sensitive content from reaching shared storage, replicas, and backups.
Centralized Logging Architectures and Their Tradeoffs
You can centralize logs using different collection, forwarding, storage, and querying patterns. These approaches can work together: a node-level collector can forward logs through a gateway and a durable stream before they reach a storage backend. Your choice depends on log volume, outage tolerance, retention requirements, and how much infrastructure you want to manage.
Start with direct ingestion when your collectors and backend can handle the workload. Add a gateway when you need shared processing or routing, and use a durable stream when backend interruptions could exceed collector buffer capacity. For longer retention, use object-storage-backed logging to control storage costs. Choose federation when logs must remain in their original systems and centralized access is sufficient.
How to Implement Centralized Logging
To implement centralized logging, identify your log sources, configure collection and forwarding, and store the records in a backend where you can search and retain them. Use the following steps to set up the pipeline across Kubernetes workloads and external services.
1. Identify Your Log Sources
Inventory application logs, Kubernetes container and node logs, control-plane and audit logs, syslog from network devices, and logs from virtual machines and managed services. Record where each source writes logs, how much data it generates, and whether it contains sensitive or compliance-related information. Prioritize sources that lose their logs when workloads or infrastructure disappear.
2. Configure Log Collection
Deploy a node-level collector as a DaemonSet to collect container logs across your Kubernetes nodes. For example, the OpenTelemetry Collector Helm chart can configure log collection and Kubernetes metadata enrichment using the following values.yaml:
Replace https://otlp.example.com:4318 with your backend’s OTLP/HTTP endpoint and configure authentication if required. The chart mounts the Kubernetes container log files, configures the log receiver, and adds the permissions needed for Kubernetes metadata enrichment. The exporter forwards records to the configured backend rather than printing them to the Collector’s standard output.
Save the configuration as values.yaml and install the Collector:
This agent-based configuration collects logs written to stdout and stderr by Kubernetes containers. Node system logs and Kubernetes audit logs require additional receivers or integrations. For managed services, use agentless API integrations where available or configure appropriate log receivers.
The Collector starts reading new log entries rather than importing existing log history. This example also doesn’t configure persistent checkpoints or disk-backed exporter queues. Configure these separately to reduce data loss during Collector restarts or backend outages.
Check the kubelet’s log rotation settings and make sure collection keeps pace with the log rate, since records rotated away before collection cannot be recovered (Kubernetes).
3. Configure Processing and Enrichment
Parse logs into consistent fields, including timestamps, severity, service names, and request identifiers where available. Attach Kubernetes metadata such as namespaces, pods, and deployments to make records searchable by workload.
Configure filtering to remove unwanted records and masking to prevent credentials or personal information from reaching shared storage. Test filtering rules against sample records before applying them across your environment.
4. Configure Forwarding and Buffering
Send logs directly to your backend or through a gateway when you need shared processing and routing. Protect external connections with TLS and configure authentication for ingestion endpoints.
Set queue capacity, retry limits, and disk-backed buffering according to log volume and expected outages. Add a durable streaming buffer when you need replay or multiple downstream consumers.
5. Configure Storage and Retention
Choose a backend that supports your search requirements, ingestion volume, and retention periods. Set retention policies by data class, restrict access to sensitive logs, and encrypt stored records.
Use lower-cost storage tiers for logs you retain but rarely query. Where audit integrity is required, configure immutable storage to prevent unauthorized modification or deletion.
6. Verify Collection and Delivery
Generate a test log with a unique identifier from a Kubernetes pod and confirm that it appears in the backend with the correct timestamp, namespace, and pod metadata. Delete the test pod and verify that its logs remain searchable.
Test a temporary delivery interruption in a staging environment to confirm that queued records arrive after recovery. Monitor queue utilization, failed exports, and dropped records to detect gaps in collection.
Securing Centralized Logs and Managing Retention
Centralized logging brings sensitive operational and security records into a shared system, making access control and data protection essential. Logs can contain customer identifiers, authentication details, and information about your infrastructure. Protect the records during collection, transmission, storage, and deletion.
Apply the following controls:
-
Encryption in transit and at rest: Use TLS between collectors, gateways, and ingestion endpoints. Encrypt stored logs, backups, and replicas to protect records if storage systems or network connections are compromised. -
Key management: Use customer-managed encryption keys when your security policies require control over key access and rotation. Grant ingestion and storage components the permissions needed to use those keys, and verify that key changes don’t interrupt log delivery or access to retained records. -
Least privilege: Enforce role-based access control (RBAC) by separating log ingestion permissions from read and administrative permissions. Restrict access by namespace, cluster, team, or data type where the backend supports it, and integrate with SSO to manage user access. -
Sensitive data protection: Mask credentials, access tokens, and personal information before logs enter shared storage. Apply filtering and redaction rules during collection or processing, and test them to confirm they don’t remove records needed for security investigations. -
Retention policies: Set retention periods according to the type of data and its operational or compliance requirements. Application debug logs can have shorter retention periods than security audit logs. Configure automatic expiration or archival and verify that records remain available for the required duration. -
Immutable storage and audit integrity: Protect security audit logs against unauthorized modification and deletion. Write-once-read-many (WORM) storage provides this protection for retained records. For example, Amazon S3 Object Lock prevents protected object versions from being deleted during their retention period in compliance mode, even by the account’s root user. Governance mode allows authorized users to bypass retention protections, while legal holds provide separate protection until they’re removed.
Compliance Requirements for Log Retention
Retention requirements differ by regulation and the systems covered. Set policies according to the obligations that apply to your organization rather than applying one retention period to every log source.
-
PCI DSS: Requirement 10.5.1 requires at least 12 months of audit-log history, with the most recent three months immediately available for analysis. This applies to audit logs within the relevant PCI DSS scope, not every operational log generated across the organization (PCI Security Standards Council). -
HIPAA: The HIPAA Security Rule requires mechanisms to record and examine activity in systems containing electronic protected health information under 45 CFR 164.312(b). Its six-year retention requirement under 45 CFR 164.316(b)(2) applies to required Security Rule documentation, not automatically to all system logs. Determine log-retention periods using your security policies and other applicable obligations (45 CFR 164.312, 45 CFR 164.316). -
SOC 2: The AICPA Trust Services Criteria cover monitoring system activity and identifying security events, including under CC7.2, but don’t prescribe a universal log-retention period. Define retention policies that support your controls, audit evidence requirements, and reporting period (AICPA Trust Services Criteria).
Review these controls regularly and test whether retained logs remain accessible after workloads are deleted or infrastructure changes. Confirm that unauthorized users cannot read or modify protected records, and that expiration policies remove data when its retention period ends.
Centralized Log Management With groundcover
groundcover is a full-stack observability platform that centralizes Kubernetes logs alongside metrics, traces, and events. Its eBPF sensor automatically collects container logs and supported application telemetry without requiring code changes or separate agents for each service.
Rather than managing separate logging and monitoring systems, you can search logs, investigate application failures, and examine related infrastructure behavior in one platform.
Automatic Log Collection Across Kubernetes Clusters
groundcover deploys its eBPF sensor as a DaemonSet, with one sensor pod per Kubernetes node. The sensor automatically collects container logs across namespaces, including JSON, plain-text, and common application log formats. It enriches the collected records with Kubernetes metadata and forwards them to the centralized backend, where they remain searchable after the original pods are removed.
The sensor also captures supported application and network telemetry without requiring application instrumentation. Existing OpenTelemetry instrumentation can complement this collection, providing additional application-level detail. The combination is explained in groundcover’s article on how eBPF and OpenTelemetry work together.
Centralizing Logs From External Sources
Beyond Kubernetes container logs, groundcover supports ingestion from external systems, including Amazon CloudWatch Logs, S3-stored logs, Fluent Bit, Fluentd, Logstash, and OpenTelemetry. This lets you bring logs from different infrastructure components into the same backend for searching and investigation.
The approach follows the broader log aggregation model: collecting records from distributed sources, processing them into searchable data, and making them accessible through a common interface. You can combine automatic sensor collection with existing log forwarding pipelines instead of replacing every collector.
Log Processing, Enrichment, and Search
groundcover uses OpenTelemetry Transformation Language (OTTL) to process logs before ingestion. Its log pipelines support parsing structured and unstructured messages, extracting attributes, filtering unwanted records, obfuscating sensitive information, and converting log data into metrics.
The Log Explorer lets you search and filter records by workload, namespace, severity, time range, and extracted attributes. Kubernetes metadata helps identify the service or pod responsible for an error, while parsing rules make application-specific fields available for more precise queries.
Correlating Logs With Metrics, Traces, and Events
groundcover combines logs with application traces, infrastructure metrics, and Kubernetes events to provide context during troubleshooting. For example, when a service experiences increased latency, you can examine related errors, request traces, resource consumption, and recent deployment events within the same platform.
When application logs contain trace identifiers, those identifiers help connect log records to the requests that generated them. Kubernetes metadata and time-range filters provide additional context when explicit trace IDs aren’t available. See groundcover’s explanation of log–trace correlation for how these signals work together.
Investigating Logs With Agent Mode
groundcover’s Agent Mode adds AI-assisted investigation to centralized log management. You can ask natural-language questions such as “Which workloads are generating the most errors?” or “Why is the checkout service returning HTTP 500 responses?” Agent Mode queries logs, traces, metrics, Kubernetes events, and resource information to identify relevant evidence.
Agent Mode also helps generate log parsing and drop rules, create dashboard and monitor drafts, and explore telemetry through groundcover’s unified query language, gcQL. Engineers can inspect its queries and results, while reusable Skills let teams apply established investigation procedures. groundcover explains these workflows in its article on Agent Mode and operational knowledge.
Data Ownership and Predictable Costs
With groundcover’s Bring Your Own Cloud (BYOC) architecture, the observability backend runs inside your cloud environment. ClickHouse stores logs, traces, and Kubernetes events, while VictoriaMetrics stores metrics. groundcover manages the backend infrastructure, and the hosted interface provides access to your data. On-premises and air-gapped deployment options are also available.
groundcover uses per-host licensing based on the average number of monitored nodes rather than charging per gigabyte of ingested logs. This means increasing log volume doesn’t increase the platform’s ingestion-based licensing charges, although the underlying compute and storage costs still depend on data volume and retention.
You can manage those infrastructure costs by applying retention policies, filtering unnecessary records, and using object storage for less frequently accessed data. groundcover’s guides on hot and cold log storage and reducing log ingestion costs explain these approaches in more detail.
FAQs
The terms overlap, but they describe different aspects of log management. Log aggregation collects and combines records from multiple sources, while centralized logging makes those records accessible through a shared system for searching, analysis, retention, and monitoring. You can aggregate logs into a streaming platform such as Kafka without providing centralized search, or centralize access through federated queries without copying the original records.
Yes. Federated querying provides a unified interface for accessing logs stored across different systems without physically consolidating them. This approach is useful when data residency requirements restrict movement or when existing storage systems must remain independent. However, query performance and availability still depend on the underlying sources, and historical logs may become inaccessible if those sources are deleted.
Use Amazon CloudWatch Logs centralization with AWS Organizations to collect logs from multiple accounts and Regions into a central logging account. Enable trusted access, then use your organization’s management account or a delegated administrator to create centralization rules specifying the source accounts, organizational units, Regions, and destination account.
CloudWatch automatically replicates matching new log events into the destination Region. You can configure retention, an optional backup Region, and encryption using an AWS KMS key with the required permissions. Centralization rules don’t backfill historical logs created before the rules were enabled (AWS documentation).
Use CloudWatch Logs Insights in your central logging account to search across log groups replicated from different AWS accounts and Regions. Centralized log events include system fields such as @aws.account and @aws.region, which let you filter results by their original account and Region. You can also group events by these fields for event correlation across workloads.
If you don’t want to copy logs, CloudWatch cross-account observability lets a monitoring account query log groups shared by linked accounts within the same Region. For unified querying across Regions from one destination, use cross-Region log centralization first (AWS CloudWatch Logs Insights).
Centralized logging costs depend on log ingestion volume, indexing, retention, queries, network transfer, and infrastructure usage. For example, collecting 100 GB of logs daily produces approximately 3 TB over 30 days before accounting for compression or replication. Providers bill these resources differently: some charge per gigabyte, while groundcover uses per-host licensing without per-GB ingestion charges.
Reduce spending through selective collection, filtering noisy logs before ingestion, retention policies by data class, and lower-cost storage for historical records. Minimize unnecessary cross-Region transfers and duplicate copies. AWS CloudWatch Logs centralization includes the first centralized copy without additional ingestion or cross-Region transfer charges, but destination storage, queries, optional additional copies, and other services can incur charges. See groundcover’s guide to reducing log ingestion costs.
Centralized logging provides security information and event management (SIEM) platforms with records from applications, identity systems, networks, and infrastructure. A SIEM can use these records for event correlation, threat detection, alerting, and incident investigation. In AWS, CloudWatch Logs subscription filters can forward events through Amazon Data Firehose (formerly Amazon Kinesis Data Firehose) or Kinesis Data Streams to supported downstream security systems.
For compliance, apply role-based access controls, encryption, audit trails, and retention policies to the collected records. Frameworks such as PCI DSS and HIPAA impose different requirements, so centralized storage alone doesn’t establish compliance. You must also verify record integrity, access restrictions, and retention against the applicable obligations.
Logging agents can buffer records and retry delivery while the backend is unavailable, depending on their configuration. Records can still be lost if queues overflow, retry limits expire, or collectors restart without persistent storage. In Kubernetes, container-log rotation can also remove records before an unavailable collector has read them.
Use disk-backed queues, durable buffering where necessary, and redundant backend components to reduce data loss. Monitor queue utilization, failed exports, and dropped records, and test recovery in a staging environment.
Yes. groundcover deploys its eBPF sensor as a DaemonSet across monitored Kubernetes clusters, automatically collecting and enriching container logs. It also supports external logs through integrations such as Amazon CloudWatch Logs, Fluent Bit, Fluentd, and OpenTelemetry.
In its BYOC deployment, logs are stored in a centralized ClickHouse backend inside your cloud environment. You can search records across clusters and correlate them with metrics, traces, and Kubernetes events. groundcover’s Agent Mode also lets you investigate these signals through natural-language queries.





