1. Caddy version (caddy version
):
v2.3.0 h1:fnrqJLa3G5vfxcxmOH/+kJOcunPLhSBnjgIvjXV/QTA=
2. How I run Caddy:
a. System environment:
Debian 10, Linux 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 GNU/Linux
b. Command:
Just an officially systemd service file
If command on terminal will be OK, it outputs console format as I wish.
c. Service/unit/compose file:
# /lib/systemd/system/caddy.service
# caddy.service
#
# For using Caddy with a config file.
#
# Make sure the ExecStart and ExecReload commands are correct
# for your installation.
#
# See https://caddyserver.com/docs/install for instructions.
#
# WARNING: This service does not use the --resume flag, so if you
# use the API to make changes, they will be overwritten by the
# Caddyfile next time the service is restarted. If you intend to
# use Caddy's API to configure it, add the --resume flag to the
# `caddy run` command or use the caddy-api.service file instead.
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target
[Service]
User=caddy
Group=srv
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
; Environment=XDG_DATA_HOME=/var
; Environment=XDG_CONFIG_HOME=/var
[Install]
WantedBy=multi-user.target
d. My complete Caddyfile or JSON config:
None about config file, I think. Just question for how to change caddy itselfās output log format
3. The problem Iām having:
Cannot set caddy itselfās log format.
4. Error messages and/or full log output:
Current journalctl caddy.service
log look like this, JSON format, human unfriendly:
Apr 19 02:44:23 srv caddy[32659]: {"level":"info","ts":1618771463.3738742,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":""}
Apr 19 02:44:23 srv caddy[32659]: {"level":"info","ts":1618771463.384001,"logger":"admin","msg":"admin endpoint started","address":"tcp/localhost:2019","enforce_origin":false,"origins":["127.0.0.1:2019","localhost:2019","[::1]:2019"]}
Apr 19 02:44:23 srv caddy[32659]: {"level":"info","ts":1618771463.3851924,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
Apr 19 02:44:23 srv caddy[32659]: {"level":"info","ts":1618771463.3854547,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv1"}
Apr 19 02:44:23 srv caddy[32659]: {"level":"info","ts":1618771463.3865013,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc000306000"}
5. What I already tried:
I have been read all reletave documents but looks only JSON file define log format, but I use caddyfile.