I cannot see access log file for specific site

This is exactly why the full config was needed. This part of full config is what’s causing the issue:

If you run caddy adapt --pretty against your Caddyfile, you will see that host name showing in the skip_hosts list under logging, which is why its access logs are missing. If you check your logs, you should see this line:

{"level":"warn","ts":1663063402.5579882,"logger":"caddyfile","msg":"Using a path in a site address is deprecated; please use the 'handle' directive instead","address":"http://tls.mk-go.fr/metrics"}

The solution for now is to rewrite your config to:

tls.mk-go.fr {
    handle /metrics {
        metrics
    }
        handle {
                reverse_proxy p-TLS-2223:80
        }
  log {
    output file /var/log/caddy/tls.mk-go.fr-access.log
  }
import common
}

Of course you lose the very benefit you were seeking after, which is excluding visits to /metrics from logging, but I don’t think that exclusion worked as you expected it anyways.

By the way, do you happen to know what was the Caddy version deployed before this last one?

3 Likes

it is already on the first post above

and do you have idea if I want to route tls.mk-go.fr:62021 , how can be the correct format of Caddyfile ?
I mean handle with port not with path

Study this page

1 Like

ok thanks for help

This topic was automatically closed after 30 days. New replies are no longer allowed.