Collecting Docker container logs
With SigNoz you can collect all your docker container logs and perform different queries on top of it. Below are the steps to collect docker container logs.
Collect Docker container logs in SigNoz cloud
Clone this repository
otel-collector-config.yamland set the values of
Depending on the choice of your region for SigNoz cloud, the otlp endpoint will vary according to this table.
Region Endpoint US ingest.us.signoz.cloud:443 IN ingest.in.signoz.cloud:443 EU ingest.eu.signoz.cloud:443
Start the containers
docker compose up -d
If there are no errors your logs will be exported and will be visible on the SigNoz UI.
Collect Docker container logs in Self-Hosted SigNoz
Steps for collecting logs if SigNoz is running on the same host.
Once you deploy SigNoz in docker, it will automatically start collecting logs of all the docker containers, except for the container logs of SigNoz.
Disable automatic container log collection.
You can disable automatic container logs collection by modifying the
otel-collector-config.yaml file which is present inside
Here we have modified the value of receivers from
[otlp, tcplog/docker] to
Now you can restart SigNoz and the changes will be applied.
If you want to exclude certain logs you can exclude them based the container name or based on pattern.
Using container name : We will modify the
otel-collector-config.yamlfile which is present inside
deploy/docker/clickhouse-setupand add a new operator after
- type: filter
expr: 'attributes.container_name matches "^(<container_name>|<container_name>)'
<container_name>with the name of the containers that you want to exclude.
If you want to collect logs of signoz containers you can remove the names of signoz containers from the filter operator with id
Based on pattern : You can also use the filter operator to filter out logs based on a pattern
- type: filter
expr: 'body matches "^LOG: .* END$"'
Here we are matching logs using an expression and dropping the entire log by setting
drop_ratio: 1.0. You can read more about the filter operator here
Now we can restart the otel collector container so that new changes are applied and the docker container logs will be dropped for the specified containers.
Steps for collecting logs if SigNoz is running on a different host.
If you have a signoz running on a different host then you can run logspout on the host and send logs to SigNoz cluster.
2255of otel-collector by modifying the
docker-compose.yamlfile present inside
docker run --net=host --rm --name="logspout" \
For finding the right host for your SigNoz cluster please follow the guide here.
If there are no errors your logs will be exported and visible on the SigNoz UI.