Hi guys!
I have a working docker-compose that uses traefik alpine. I am using debian 9 as the main distro.
The problem is that its not writing any logfiles.
My docker-compose.yml looks like this
version: "3"
services:
traefik:
container_name: traefik
image: traefik:alpine
networks:
- server
ports:
- 80:80
- 443:443
volumes:
- /opt/traefik/traefik.toml:/traefik.toml:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /opt/traefik/acme.json:/acme.json
labels:
- traefik.enable=true
- traefik.port=8080
- traefik.frontend.rule=Host:top.example.xyz
command:
- --accessLog=true
- --logLevel=INFO
- --accessLog.filePath="/opt/traefik/access.log"
- --traefikLog.filePath="/opt/traefik/traefik.log"
- --traefikLog.format="json"
- --accessLog.format="json"
networks:
server:
external: true
And traefik.toml
logLevel = "INFO"
checkNewVersion = true
defaultEntryPoints = ["http", "https"]
[entryPoints]
[entryPoints.dashboard]
address = ":8080"
[entryPoints.dashboard.auth]
[entryPoints.dashboard.auth.basic]
users = ["test:$apr1$k56KsfIu$7RI1JNkmwXpjqyaLPYuIA."]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[api]
entrypoint="dashboard"
dashboard = true
[retry]
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "example.xyz"
exposedByDefault = false
watch = true
[acme]
email = "example@example.com"
storage = "acme.json"
entryPoint = "https"
onHostRule = true
[acme.httpChallenge]
entryPoint = "http"
I am using traefik:alpine and the version is v1.7.12 and I changed my real domain to example.
I've tried different locations for access.log and traefik.log but nothing seems to be created. My purpose is to get it create logfiles so I can implement it with fail2ban.