1. Caddy version (caddy version
):
v2.2.0
2. How I run Caddy:
caddy-api on ubuntu vm
a. System environment:
ubuntu 20.04
b. Command:
systemctl start caddy-api
c. Service/unit/compose file:
# caddy-api.service
#
# For using Caddy with its API.
#
# This unit is "durable" in that it will automatically resume
# the last active configuration if the service is restarted.
#
# See https://caddyserver.com/docs/install for instructions.
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target
[Service]
User=caddy
Group=caddy
Environment="CONSUL_HTTP_ADDR=https://consul01p.net.work:8500"
ExecStart=/usr/bin/caddy run --environ --resume
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
d. My complete Caddyfile or JSON config:
This is the part I think I have trouble since everything else is working fine, proxy, tls, etc…
"logging":{
"logs":{
"account":{
"encoder":{
"format":"json"
},
"include":[
"http.log.access.account"
],
"level":"INFO",
"writer":{
"filename":"/tmp/account.log",
"output":"file"
}
},
"arkliv":{
"encoder":{
"format":"json"
},
"include":[
"http.log.access.arkliv"
],
"level":"INFO",
"writer":{
"filename":"/tmp/arkliv.log",
"output":"file"
}
},
"default":{
"encoder":{
"format":"json"
},
"exclude":[
"http.log.access.account",
"http.log.access.arkliv"
],
"level":"INFO",
"writer":{
"filename":"/tmp/caddy.log",
"output":"file"
}
}
},
"sink":{
"writer":{
"filename":"/tmp/caddy-temp.log",
"output":"file"
}
}
}
3. The problem I’m having:
As you can see I want long of a specific site going to it’s own log file.
Unfortunately nothing is created and in caddy.log or caddy-temp.log I don’t have any log showing access to this 2 sites ( as expected with exclude).
4. Error messages and/or full log output:
No error message.
5. What I already tried:
I tried to adapt a Caddyfile
exa.com
{
root * /www/exa.com
reverse_proxy /gg localhost:10000
log {
output file /tmp/exa_access.log
}
and it did not gave me relevant informations at all except this part which turn out not working when I put it in my config.
"logs":{
"logger_names":{
"exa.com":"log0"
}
}
Thanks in advance,
Regards.