Documentation Index
Fetch the complete documentation index at: https://mintlify.com/traefik/traefik/llms.txt
Use this file to discover all available pages before exploring further.
Logging Configuration
Traefik logs capture all operational events including startup, configuration changes, errors, and system warnings. By default, logs are written to stdout in text format.Basic Configuration
Logs are enabled by default. Configure log level and format:Configuration Options
Log Level
Set the logging level to control verbosity.
TRACE- Most verbose, includes all debug informationDEBUG- Detailed debugging informationINFO- General informational messagesWARN- Warning messagesERROR- Error messages (default)FATAL- Fatal errors that cause terminationPANIC- Panic-level errors
File Path
Path to the log file. If not specified, logs are written to stdout.
filePath is specified, Traefik writes logs only to the file (not to stdout). Intermediate directories are created automatically.
Format
Log output format:
common (text) or json.- Common (Text)
- JSON
Human-readable text format with optional colors:Example output:
Disable Colors
Disable colorized output when using the common format.
Log Rotation
Configure automatic log rotation to prevent disk space issues:Max Size
Maximum size in megabytes before rotation.
Max Backups
Maximum number of old log files to retain.
Max Age
Maximum number of days to retain old log files.
Compression
Compress rotated log files using gzip.
Complete Rotation Example
OpenTelemetry Logs
Experimental FeatureOpenTelemetry logs are currently experimental and must be explicitly enabled.
Enable Experimental Feature
https://localhost:4318/v1/logs.
Service Name
Service name resource attribute for OTLP logs.
Resource Attributes
Additional resource attributes sent to the collector.
HTTP Configuration
Send logs via HTTP to the OpenTelemetry Collector:To disable TLS, use
http:// instead of https:// in the endpoint URL.gRPC Configuration
Send logs via gRPC to the OpenTelemetry Collector:Complete Examples
Production Logging Setup
Development Setup
OpenTelemetry Integration
External Log Rotation
On Linux/Unix systems, you can uselogrotate for external log rotation. Traefik responds to USR1 signals to reopen log files:
Windows SupportUSR1 signal rotation is not supported on Windows.