Error with "unrecognized directive: log_level"

1. The problem I’m having:

“unrecognized directive” error after adding log_level to host configuration in Caddyfile

2. Error messages and/or full log output:

{
  "level":"info",
  "ts":1796488253.341904,
  "logger":"docker-proxy",
  "msg":"Process Caddyfile",
  "logs":"[ERROR]  Removing invalid block: Caddyfile:20: unrecognized directive: log_level\nhomarr.home.example.com {\n\timport acme-rfc2136\n\tlog_level /api/health/live ERROR\n\treverse_proxy homarr:7575\n}\n\n"
}

3. Caddy version:

Docker latestsha256:34b7a3f3b68814a3911ab2c5227bbff08f851b67e7b0d8d8923b07bb08bccd0d

4. How I installed and ran Caddy:

Docker

a. System environment:

Everything else works

b. Command:

Everything else works

c. Service/unit/compose file:

Everything else works

d. My complete Caddy config:

homarr.home.example.com {
    # Certificate configuration/generation
    import acme-rfc2136

    # Specific log levels for paths (most specific path wins)
    log_level /api/health/live ERROR

    # Reverse proxy configuration
    reverse_proxy homarr:7575
}

5. Links to relevant resources:

https://caddyserver.com/docs/caddyfile/directives/log_level

We need the caddy version, not the sha.

I assumed latest was enough. v2.11.9

latest in Docker is a pseudo tag that may stale or be overriden by real latest. You chose to omit your Dockerfile and docker-compose, so I can’t even attempt to help you if I could. You’ll need to figure out the real version and share it.

Which I did above in my reply