-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
logs.skip_hosts is ignored #6248
Comments
We've made significant changes to logging since 2.7.6. Please try with the master branch. |
First I've built caddy using
With this newly built image I have no access log in
BUT it works as expected with
which adds logging section in
|
Interesting, okay I can replicate this. Investigating... |
I think I have a fix in #6251, can you give it a shot? You can build with |
Now it's the same as in v2.7.6. There're access log records for all three domains in stderr, though
Here's my Dockerfile to build Caddy. |
That's not the behaviour I see. If you redact your domains, I can't know with certainty that we're trying the same thing. |
Ok, I've made a minimal reproducible example: services:
caddy:
image: winand/caddy:2.7.6-default-logger-3
container_name: caddy
volumes:
- ./caddy-data:/data/caddy
- ./Caddyfile:/etc/caddy/Caddyfile
ports:
- "80:80"
- "2053:443"
restart: unless-stopped
networks:
default:
name: caddy-network Caddyfile:
Do requests: curl -k https://domain2.localhost:2053
curl -k https://domain1.localhost:2053 Docker container logs:
I assumed that only |
Update. |
Ah right so the problem is with the port being included in the |
[~]$ docker exec caddy caddy version Built using this Dockerfile with command |
Okay, I figured it out, I missed a spot when dropping the port when checking logger config. Updated #6251, you can try building from commit |
I run xcaddy in Dockerfile build stage, so each time it's a fresh build for Go tooling. ✅The problem is resolved in version v2.7.6-0.20240421110859-6ef4c4dfcd0f |
Caddy 2.7.6 in Docker. Port forwarding: 80(host) -> 80(caddy), 2999(host) -> 443(caddy)
I have several domain names in Caddyfile, only one of them has log enabled.
In
caddy adapt
output I see that domain 1 and 3 are added toskip_hosts
:But access log records for all three domains appear in
docker logs caddy
. Is it the expected behaviour?Of course I can add
skip_log
to domains 1 and 3 but why skip_hosts does not disable logs?The text was updated successfully, but these errors were encountered: