您是否知道Traefik日志位于何处?我阅读了Traefik上的文档,并说它将输出到stdout,但是当我使用docker-compose up -d启动docker容器时,在尝试域名并拉出多个链接的docker容器后,stdout中没有任何显示.@H_404_2@
我也尝试指定这些:@H_404_2@
@H_404_2@
[traefikLog]
filePath = "./traefik.log" #<--Tried this but It doesn't work,file empty and permissions set to 777
[accessLog]
filePath = "./access.log" #<--Tried this but doesn't work,file empty and permissions set to 777
我很困惑,我错过了什么吗?还是Traefik应该这么安静?@H_404_2@
当我运行它时,这就是我所看到的,之后什么也没有.@H_404_2@
@H_404_2@
# docker-compose up
Creating traefik ... done
Attaching to traefik
附件是我的配置.谢谢.@H_404_2@
traefik / traefik.toml:@H_404_2@
@H_404_2@
logLevel = "DEBUG"
defaultEntryPoints = ["http","https"]
[api]
address = ":8080"
[traefikLog]
filePath = "./traefik.log" #<--Tried this but It doesn't work
[accessLog]
filePath = "./access.log" #<--Tried this but doesn't work
[entryPoints]
[entryPoints.http]
#redirect ALL http traffic to https 443
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
#Let's encrypt setup
[acme]
email = "email@email.com"
storage = "acme.json"
entryPoint = "https"
acmeLogging = true
#When new host is created,request certificate.
onHostRule = true
onDemand = false
[acme.httpChallenge]
entryPoint = "http"
#Watch Docker,when new containers are created with label create mapping.
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "exampledomain.net"
watch = true
exposedbydefault = false
docker-compose.yml:@H_404_2@
@H_404_2@
version: '3'
services:
traefik:
hostname: traefik
domainname: exampledomain.net
image: traefik:alpine
command: --api --docker
container_name: traefik
networks:
- Nginx-proxy
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "./traefik/traefik.toml:/traefik.toml"
- "./traefik/acme.json:/acme.json"
labels:
- "traefik.enable=true"
- "traefik.port=8080"
- "traefik.frontend.rule=Host:monitor.exampledomain.net"
- "traefik.docker.network=Nginx-proxy"
networks:
Nginx-proxy:
external:
name: Nginx-proxy