The log Caddyfile directive is for per-site access log output configuration. It doesn’t affect the default logging that you’re seeing in stdout/stderr. The details on the log Caddyfile directive are here: log (Caddyfile directive) — Caddy Documentation
I recommend going over the article we have explaining this, specifically the part about the logging pipeline in Caddy. It touches a little bit on the difference: How Logging Works — Caddy Documentation
The logging article links additionally to the JSON logging configuration, which has details and explanation of how to configure the default logger, which is what you’re seeing on stdout/stderr: JSON Config Structure - Caddy Documentation