I'm trying to logrotate access logs with traefik docker on the host. When logrotate run it create a new log file, great, but it always to zero like if the docker volume was not remount. On traefik docker the access log still continue to grow. What is the trick to logrotate my access log ? thx
my /etc/logrotate.d/traefik
/var/www/traefik_access.log {
size 10K
rotate 30
missingok
notifempty
compress
dateext
dateformat .%Y-%m-%d
create 0644 www-data www-data
postrotate
docker kill --signal="USR1" traefik
endscript
}
my docker-compose.yml :
version: '3'
services:
traefik:
image: traefik:latest
container_name: traefik
restart: always
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.toml:/traefik.toml
- ./acme.json:/acme.json
- ./traefik_access.log:/access.log
networks:
- web
my files
-rw-r--r-- 1 www-data www-data 1818 août 7 11:30 traefik_access.log.2019-08-07.gz
-rw-r--r-- 1 www-data www-data 0 août 7 11:30 traefik_access.log