Traefik Access logs showing on stdout but not in access.log

Hi,

Im trying to get started with traefik v2.9
I installed it using Helm

NAME: traefik
LAST DEPLOYED: Wed Dec 21 16:23:47 2022
NAMESPACE: traefik
STATUS: deployed
REVISION: 2
TEST SUITE: None
NOTES:
Traefik Proxy v2.9.6 has been deployed successfully
on traefik namespace !

I followed this to get access logs for my traffic. I installed it with a custom values.yaml with helm.

Here's the relevant part in values.yaml:

logs:
  ## Traefik logs concern everything that happens to Traefik itself (startup, configuration, events, shutdown, and so on).
  general:
    # By default, the logs use a text format (common), but you can
    # also ask for the json format in the format option
    # format: json
    # By default, the level is set to ERROR.
    # Alternative logging levels are DEBUG, PANIC, FATAL, ERROR, WARN, and INFO.
    level: ERROR
  access:
    # To enable access logs
    enabled: true
    ## By default, logs are written using the Common Log Format (CLF) on stdout.
    ## To write logs in JSON, use json in the format option.
    ## If the given format is unsupported, the default (CLF) is used instead.
    format: json
    filePath: "/var/log/traefik/access.log"
    ## To write the logs in an asynchronous fashion, specify a bufferingSize option.
    ## This option represents the number of log lines Traefik will keep in memory before writing
    ## them to the selected output. In some cases, this option can greatly help performances.
    bufferingSize: 2
    ## Filtering https://docs.traefik.io/observability/access-logs/#filtering
    filters: {}
      # statuscodes: "200,300-302"
      # retryattempts: true
      # minduration: 10ms
    ## Fields
    ## https://docs.traefik.io/observability/access-logs/#limiting-the-fieldsincluding-headers
    fields:
      general:
        defaultmode: keep
        names: {}
      headers:
        defaultmode: keep
        names: {}

Deployed, and checked the pod logs without the filePath parameter, and all the logs are being printed as expected on the console. However, as soon as I use the filePath parameter, the file is not being created within the container. I exec'd into the container to check and no file was being created.

I also checked the description to see if the required parameters are present by describing the pod:

Containers:
  traefik:
    Container ID:  containerd://8a4f576d01c55cda8ef2d5771cb591a6206c6c4a006e94bbb5f872389a9a86d9
    Image:         traefik:v2.9.6
    Image ID:      docker.io/library/traefik@sha256:bb7be8d50edf73d8d3a812ac8873ef354a0fe9b40d7f3880747b43a3525855d2
    Ports:         9100/TCP, 9000/TCP, 8000/TCP, 8443/TCP
    Host Ports:    0/TCP, 0/TCP, 0/TCP, 0/TCP
    Args:
      --global.checknewversion
      --global.sendanonymoususage
      --entrypoints.metrics.address=:9100/tcp
      --entrypoints.traefik.address=:9000/tcp
      --entrypoints.web.address=:8000/tcp
      --entrypoints.websecure.address=:8443/tcp
      --api.dashboard=true
      --ping=true
      --metrics.prometheus=true
      --metrics.prometheus.entrypoint=metrics
      --providers.kubernetescrd
      --providers.kubernetesingress
      --entrypoints.websecure.http.tls=true
      --accesslog=true
      --accesslog.format=json
      --accesslog.filepath=/var/log/traefik/access.log
      --accesslog.bufferingsize=2
      --accesslog.fields.defaultmode=keep
      --accesslog.fields.headers.defaultmode=keep
    State:          Running
      Started:      Wed, 21 Dec 2022 17:38:17 +0530
    Ready:          True
    Restart Count:  0
    Limits:
      cpu:     300m
      memory:  150Mi
    Requests:
      cpu:        100m
      memory:     50Mi
    Liveness:     http-get http://:9000/ping delay=2s timeout=2s period=10s #success=1 #failure=3
    Readiness:    http-get http://:9000/ping delay=2s timeout=2s period=10s #success=1 #failure=1
    Environment:  <none>
    Mounts:
      /data from data (rw)
      /tmp from tmp (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-4gkw4 (ro)
Conditions:

I am a bit stumped. Can anyone help here, or point out mistakes that I am making?

The only other changes I have made in the values.yaml file while installing with helm are as follows:

deployment:
  replicas: 2
  labels:
    app: traefik

The docs clearly state:

accessLog:
  filePath: "/path/to/access.log"

So to me at least values.yaml looks not correct.

Hi,

I am using helm to install, and using this helm chart as base values.yaml.

I don't see any accessLog section within the entire file.
I manually added it to test, and it still doesn't work.

accessLog:
  filePath: "/traefik-logs/access.log"
  format: json
  bufferingSize: 2
  fields:
    defaultMode: keep
    names:
      ClientUsername: drop
    headers:
      defaultMode: keep

Do I need to add something else as well for the helm chart to work?