Why traefik doesn't output logfile?

I'm trying to set up traefik with docker-compose.
But, traefik doesn't output logfile.
Why?

My docker-compose.yml is here

  traefik:
    image: traefik:latest
    restart: unless-stopped
    command:
      - "--log.level=DEBUG"
      - "--accesslog=/var/log/access.log"
      - "--log=/var/log/traefik.log"
      - "--api.insecure=true"
      - "--providers.docker=true"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "./traefik_log:/var/log"

./traefik_log/ directory is empty...
How to output logfile with docker-compose?
I need traefik logfile for investigate my traefik problems.

Thanks.

Default is to log to stdout. Visible with docker logs command. So --accesslog is enough usually.

To define a file for accesslog.
--accesslog.filepath=/path/to/foo

1 Like

@cakiwi
Thank you for your advice.
My problem is solved.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.