How can I redirect stdout of traefik ingress to file on k8s?

Hi. I'm using traefik as ingress.

I tried to write access log to file on k8s chaning values of helm chart but failed.

So I want to redirect stdout to file. How can I do this?

Can I define a (sidecar) container in traefik pod only fixing values.yaml?

Hello @joey-yoonsung

You should try to just enable accessLog and set the format to JSON. The logs should be than redirected to stdout. There is no need to create sidecar containers that is reading the accesslog from file.

See the official docs for that feature.

The example of static configuration used as a file:

accessLog:
  format: json

or via CLI:

--accesslog=true
--accesslog.format=json
1 Like