Help with config for file logging on Docker/Truenas Scale

Truenas is set up with both docker and file providers, with the file provider pointed to a mapped folder. I am successfully using the file provider to configure both importing my certs and the reverse proxy connection for the Truenas administration interface.

I'm trying to add both error and access logs to a mapped folder (/mnt/logs in the container). I can enter the docker shell for the container and touch a test file so the permissions seem to be set up correctly for the mount.

The dashboard shows Tracing, Metrics, & Access Log as Off. I must have something wrong and/or missing in my configuration files but I can't figure out what they are based on documentation and no errors/warnings are surfacing anywhere.

error_logs.yaml

log:
  filePath: "/mnt/logs/error.log"
  format: common
  level: ERROR
  maxAge: 7
  maxBackups: 2

access_logs.yaml

accessLog:
  filePath: "/mnt/logs/access.log"
  format: common
  addInternals: true

  # Filter on status codes, retry attempts and minimal duration
  filters:
    statusCodes:
      - "200"
      - "300-302"
    retryAttempts: true
    minDuration: "10ms"

  fields:
    defaultMode: keep # Keep all the fields by default
    names:
      ClientUsername: drop # Drop the Field ClientUserName
    headers:
      defaultMode: keep # Keep all the headers by default
      names:
        User-Agent: redact # Redact the User-Agent header value
        Authorization: drop # Drop the Authorization header value
    queryParameters:
      defaultMode: drop # Drop all query parameters

  buffering:
    maxMessages: 100 # Log messages are buffered before being written.
    maxAge: 10s # Flush buffer every 10 seconds.
    flushInterval: 5s # Or flush every 5 seconds, whichever comes first.


What am I missing? Do I need a plugin or something? Am I missing a piece of configuration?

I think the issue is where you're loading those YAML files. log and accessLog belong to Traefik's static configuration, not the dynamic file provider.

Try moving them into your main traefik.yml (or using CLI flags) and restarting Traefik. Your /mnt/logs mount sounds fine if you can already write to it.