I start caddy via systemctl
on Ubuntu so I believe I need to include a log
directive in my Caddyfile
, as output is otherwise lost (sent to stderr
of a background/disconnected process).
But while the default log format includes the host name, it appears that I must set up logging for every single host that I configure, i.e. I cannot set this in the global options, the best I can do is include a snippet, so I end up with a Caddyfile
like this:
(logging) {
log {
output file /var/log/access.log
format json {
time_format iso8601
}
}
}
example.com {
import logging
⋮
}
www.example.com {
import logging
⋮
}
api.example.com {
import logging
⋮
}
⋮
Am I missing something? How do others deal with log files?