• Logs
    • Configuration
      • General
        • filePath
        • format
        • level
    • Log Rotation

    Logs

    Reading What's Happening

    By default, logs are written to stdout, in text format.

    Configuration

    General

    Traefik logs concern everything that happens to Traefik itself (startup, configuration, events, shutdown, and so on).

    filePath

    By default, the logs are written to the standard output.You can configure a file path instead using the filePath option.

    1. # Writing Logs to a File
    2. [log]
    3. filePath = "/path/to/traefik.log"
    1. # Writing Logs to a File
    2. log:
    3. filePath: "/path/to/traefik.log"
    1. # Writing Logs to a File
    2. --log.filePath="/path/to/traefik.log"

    format

    By default, the logs use a text format (common), but you can also ask for the json format in the format option.

    1. # Writing Logs to a File, in JSON
    2. [log]
    3. filePath = "/path/to/log-file.log"
    4. format = "json"
    1. # Writing Logs to a File, in JSON
    2. log:
    3. filePath: "/path/to/log-file.log"
    4. format: json
    1. # Writing Logs to a File, in JSON
    2. --log.filePath="/path/to/traefik.log"
    3. --log.format="json"

    level

    By default, the level is set to ERROR. Alternative logging levels are DEBUG, PANIC, FATAL, ERROR, WARN, and INFO.

    1. [log]
    2. level = "DEBUG"
    1. log:
    2. level: DEBUG
    1. --log.level="DEBUG"

    Log Rotation

    Traefik will close and reopen its log files, assuming they're configured, on receipt of a USR1 signal.This allows the logs to be rotated and processed by an external program, such as logrotate.

    Note

    This does not work on Windows due to the lack of USR signals.