Skip to main content

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

string
default:"ERROR"
Set the logging level to control verbosity.
Available log levels (in order of verbosity):
  • TRACE - Most verbose, includes all debug information
  • DEBUG - Detailed debugging information
  • INFO - General informational messages
  • WARN - Warning messages
  • ERROR - Error messages (default)
  • FATAL - Fatal errors that cause termination
  • PANIC - Panic-level errors

File Path

string
default:"stdout"
Path to the log file. If not specified, logs are written to stdout.
When filePath is specified, Traefik writes logs only to the file (not to stdout). Intermediate directories are created automatically.

Format

string
default:"common"
Log output format: common (text) or json.
Human-readable text format with optional colors:
Example output:

Disable Colors

boolean
default:"false"
Disable colorized output when using the common format.

Log Rotation

Configure automatic log rotation to prevent disk space issues:

Max Size

integer
default:"100"
Maximum size in megabytes before rotation.

Max Backups

integer
default:"unlimited"
Maximum number of old log files to retain.

Max Age

integer
default:"unlimited"
Maximum number of days to retain old log files.

Compression

boolean
default:"false"
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

Default protocol is HTTPS to https://localhost:4318/v1/logs.

Service Name

string
default:"traefik"
Service name resource attribute for OTLP logs.

Resource Attributes

object
default:"{}"
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 use logrotate for external log rotation. Traefik responds to USR1 signals to reopen log files:
Windows SupportUSR1 signal rotation is not supported on Windows.