-
-
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
v2: Logs configuration doesn't work when port is non-standard on Docker #3488
Comments
I'm pretty sure the specific reason for the issue is the log handler not matching against the I think the log handler should try with "hostport" first, and if that doesn't have a |
I just hit this issue and I can confirm the issue is exactly how @francislavoie described. As soon as I set the |
First try an exact lookup like before, but if it fails, strip the port and try again. example.com:1234 should still use a logger keyed for example.com if there is no key example.com:1234.
Thanks for the report - can you please try #3522 and see if that fixes it for you all? |
@mholt Confirmed! Working as expected now! Thanks! |
This is a follow up regarding this issue I opened in the forums.
I first discovered this while I was migrating to v2.
Goal
Migrate to v2 and keep the logging the way it has been. I am not ready to use JSON yet as it is mostly a side project where I
tail
to look for errors.Problem
While doing the migration, I noticed
format single_field common_log
didn't work. In fact, nothing worked withformat ...
. So I started creating a small example. Here is theCaddyfile
I used.I ran the code with docker using
docker run -v $(pwd)/Caddyfile:/etc/caddy/Caddyfile -p 81234:80 -it caddy
Which prints
More investigation
I initially thought the problem might be something with interactive mode in Docker. But as Mathew pointed out in the forum, this seems to be related to the port.
Doing
docker run -v (pwd)/Caddyfile:/etc/caddy/Caddyfile -p 80:80 -it caddy
fixed the problem.When using docker, port 80 is usually randomly mapped, which makes this bug even more relevant.
The text was updated successfully, but these errors were encountered: