Collecting Docker Container Logs
You can easily collect all your Docker container logs using OpenTelemetry Collector and perform advanced queries to analyze them efficiently using SigNoz.
Collect Docker Container Logs in SigNoz Cloud
Clone the Repository
git clone https://github.com/SigNoz/docker-container-logs
This repository provides a pre-configured OpenTelemetry Collector setup with
otel-collector-config.yaml
anddocker-compose.yaml
, enabling easy log collection and forwarding to SigNoz Cloud with minimal changes and no manual configuration.Update Environment Variables
Update the Environment variables in the
.env
file ofdocker-container-logs
repository:OTEL_COLLECTOR_ENDPOINT=ingest.<region>.signoz.cloud:443 SIGNOZ_INGESTION_KEY=<your-ingestion-key>
- Replace
<your-ingestion-key>
with your SigNoz Cloud ingestion key - Set the
<region>
to match your SigNoz Cloud region
- Replace
Start Containers
Run the following command inside thedocker-container-logs
to start the containers:docker compose up -d
Verify Log Export
If there are no errors, your logs will be exported and visible on the SigNoz UI.
Using Logspout-SigNoz for Enhanced Log Collection
To improve log organization and insight, especially for JSON logs containing serviceName
and env
fields, use the logspout-signoz extension. It labels logs with service names, severity levels, and environment details.
For detailed setup instructions, check the Rich Logs Collector for Docker Compose Services with SigNoz guide.