Issue Details
Caddy simply writes to stdout/stderr by default. This is perfectly fine, but makes it rather cumbersome to filter events of a certain level using journalctl later on.
The good thing is that systemd interprets a custom level prefix by default: https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#SyslogLevelPrefix=
Here you can find the list of levels: https://www.freedesktop.org/software/systemd/man/latest/sd-daemon.html
#define SD_EMERG "<0>" /* system is unusable */
#define SD_ALERT "<1>" /* action must be taken immediately */
#define SD_CRIT "<2>" /* critical conditions */
#define SD_ERR "<3>" /* error conditions */
#define SD_WARNING "<4>" /* warning conditions */
#define SD_NOTICE "<5>" /* normal but significant condition */
#define SD_INFO "<6>" /* informational */
#define SD_DEBUG "<7>" /* debug-level messages */
e.g this line would be logged as a warning to journald with the <4> prefix getting stripped:
<4>{"level":"warn","ts":1775048791.656852,"logger":"http","msg":"HTTP/2 skipped because it requires TLS","network":"tcp","addr":":80"}
It would be nice if either caddy would output the prefix by default if executed via systemd or it could be enabled per configuration.
Assistance Disclosure
AI not used
If AI was used, describe the extent to which it was used.
No response
Issue Details
Caddy simply writes to stdout/stderr by default. This is perfectly fine, but makes it rather cumbersome to filter events of a certain level using
journalctllater on.The good thing is that systemd interprets a custom level prefix by default: https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#SyslogLevelPrefix=
Here you can find the list of levels: https://www.freedesktop.org/software/systemd/man/latest/sd-daemon.html
e.g this line would be logged as a warning to journald with the
<4>prefix getting stripped:It would be nice if either caddy would output the prefix by default if executed via systemd or it could be enabled per configuration.
Assistance Disclosure
AI not used
If AI was used, describe the extent to which it was used.
No response