I have tried to setup logging with this docker-compose
version: '3.7'
services:
traefik:
image: traefik:latest
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=traefik"
- "--providers.docker.swarmMode=false"
- "--providers.docker.endpoint=unix:///var/run/docker.sock"
- "--providers.docker.useBindPortIP=true"
- "--accesslog=true"
- "--log.level=DEBUG"
- "--log.filePath=/opt/traefik/traefik.log"
- "--accesslog.bufferingsize=1000"
- "--accesslog.filepath=/opt/traefik/access.log"
- "--entrypoints.web.address=:80"
- "--entryPoints.web.proxyProtocol.trustedIPs=127.0.0.1/32"
ports:
- 80:80
- 8080:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.log:/opt/traefik/traefik.log
- ./access.log:/opt/traefik/access.log
networks:
- traefik
networks:
traefik:
name: traefik
docker-compose exec traefik cat /opt/traefik/access.log
and problem is that /opt/traefik/access.log is empty dir not log file. when i tried to cat logfile it will failed on error file is directory. Where can be problem ?