Logging both JSON and common formats for the same site

It’s not possible from the Caddyfile currently, but it is possible if you use JSON config instead.

The logging config has been purposefully kept simple so far because it’s quite complex to configure logging for individual sites; the logging app is a completely separate system from the http app, as you’ll see in the underlying JSON config.

I suggest you open an issue on GitHub to ask for this.

For now though, I suggest you set up some tooling separately that reads from the JSON logs and writes the common_log field (which is included in the JSON) to another file. You can do this with jq pretty easily, a CLI tool that manipulates JSON, but you’ll need to find something that keeps it running continually as new logs are streamed in.

This might be useful for you: