Collecting Application Logs from Log File

SigNoz Cloud - This page applies to SigNoz Cloud editions.
Self-Host - This page applies to self-hosted SigNoz editions.

Overview

This documentation provides instructions on configuring the OpenTelemetry Collector with the filelog receiver to read application logs from a file and export them to SigNoz.

The filelog receiver tails and parses logs from files, making it ideal for legacy applications or systems that write logs to disk rather than stdout/stderr.

Prerequisites

Sample Log File

For this guide, you can create a sample log file named app.log at /tmp/app.log (or any accessible path) with the following content:

2026-01-12T10:00:00.000Z INFO [main] Application started successfully
2026-01-12T10:00:01.500Z INFO [auth] User 'alice' logged in from 192.168.1.10
2026-01-12T10:00:02.100Z WARN [db] Query execution took longer than 500ms
2026-01-12T10:00:03.200Z ERROR [payment] Payment gateway timeout for transaction #12345

Configure Filelog Receiver

The following steps guide you through configuring the filelog receiver on different platforms.

1. Install OpenTelemetry Collector

Follow this guide to install the OpenTelemetry Collector as an agent on your Virtual Machine.

2. Edit Configuration File

Locate your OpenTelemetry Collector configuration file (typically config.yaml or /etc/otel-collector/config.yaml).

Add the filelog receiver to the receivers section:

otel-collector-config.yaml
receivers:
  filelog/app:
    include: [/tmp/app.log] # Replace with your actual log file path
    start_at: end

The /app suffix in filelog/app is a custom identifier that allows you to configure multiple filelog receivers with different settings. You can name differently for different apps (e.g., filelog/nginx, filelog/application).

3. Enable in Pipeline

Add the filelog receiver to your logs pipeline in the service section of your configuration.

otel-collector-config.yaml
service:
  pipelines:
    logs:
      receivers: [otlp, filelog/app] # Add filelog/app here
      processors: [batch]
      exporters: [otlp]

4. Restart Collector

Restart the OpenTelemetry Collector service for changes to take effect.

sudo systemctl restart otel-collector

Tagging Logs from Multiple Applications

When several named filelog receivers (such as filelog/app above) feed the same collector, tag each one so you can tell which application a log came from.

Automatic file-based tags

include_file_name defaults to true, so every log already carries a log.file.name attribute. Set include_file_path: true to also capture the full path as log.file.path. If each application writes to its own file, this alone is enough to separate them, no extra config needed.

Custom tags per application

To tag logs with your own identifier instead, such as service.name, add a resource or attributes map directly under each named receiver:

otel-collector-config.yaml
receivers:
  filelog/nginx:
    include: [/var/log/nginx/access.log]
    start_at: end
    resource:
      service.name: nginx
  filelog/payments:
    include: [/var/log/payments/app.log]
    start_at: end
    resource:
      service.name: payments

Add both receivers to the logs pipeline as usual:

otel-collector-config.yaml
service:
  pipelines:
    logs:
      receivers: [otlp, filelog/nginx, filelog/payments]
      processors: [batch]
      exporters: [otlp]

resource sets resource-level attributes, filterable the same way as service.name on any other signal. attributes sets log-record-level attributes instead. Both fields are documented in the filelog receiver README.

For tags that should apply to every log from this collector rather than one application, such as deployment.environment, use the resource processor instead.

Once tagged, use Logs Pipelines to parse or rename these attributes, for example turning log.file.name into a friendlier field, directly from the SigNoz UI.

Validate Logs

Once configured and restarted, generate some new logs in your file:

echo "Testing SigNoz filelog receiver $(date)" >> /tmp/app.log
echo "2026-01-12T12:00:00.000Z INFO [test] Manual log entry for verification" >> /tmp/app.log
echo "2026-01-12T12:00:01.500Z INFO [test] Manual log entry for verification" >> /tmp/app.log
echo "2026-01-12T12:00:02.100Z INFO [test] Manual log entry for verification" >> /tmp/app.log
echo "2026-01-12T12:00:03.200Z INFO [test] Manual log entry for verification" >> /tmp/app.log

For Windows, use PowerShell:

Add-Content -Path "C:\Logs\app.log" -Value "Testing SigNoz filelog receiver $(Get-Date)"
Add-Content -Path "C:\Logs\app.log" -Value "2026-01-12T12:00:00.000Z INFO [test] Manual log entry for verification"

Go to the SigNoz UI -> Logs tab. You should see your new log entries appearing.

Logs of the dummy app.log file visible in SigNoz
Sample log file data shown in SigNoz Logs Explorer

Troubleshooting

Logs not appearing in SigNoz

  1. Check File Permissions: Ensure the OpenTelemetry Collector user has read permissions for the log file. On Linux, the collector usually runs as otel or root.
    ls -l /tmp/app.log
    # Adjust permissions if necessary
    chmod 644 /tmp/app.log
  2. Verify Path: Double-check the path in the include config. For glob patterns (e.g. *.log), ensure it matches the actual files.
  3. Check start_at Setting: If you set start_at: end (default), the collector only reads new lines written after the collector starts. To see existing lines, change to start_at: beginning and restart the collector.
  4. Check Collector Logs: Look at the OTel Collector's own logs for errors (e.g. "permission denied", "no files found").
    # For systemd
    journalctl -u otel-collector -f
    # For Docker
    docker logs signoz-otel-collector

Advanced Configuration

Next Steps

Get Help

If you need help with the steps in this topic, please reach out to us on SigNoz Community Slack. If you are a SigNoz Cloud user, please use in product chat support located at the bottom right corner of your SigNoz instance or contact us at cloud-support@signoz.io.

Last updated: July 17, 2026

Edit on GitHub

Was this page helpful?

Your response helps us improve this page.