1. Caddy version (caddy version
): v2.4.5
2. How I run Caddy:
I run caddy using the JSON config. I write a Caddyfile then Adapt it and load the config.
It’s not containerised.
a. System environment:
Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-88-generic x86_64)
b. Command:
caddy start
c. Service/unit/compose file:
Not being used.
d. My complete Caddyfile or JSON config:
{
on_demand_tls {
ask http://my_server/allowed
interval 2m
burst 5
}
order rate_limit before basicauth
log {
level DEBUG
output file /var/log/caddy/access.log {
roll_size 50mb
roll_keep 50
}
}
storage redis {
host "redis_server"
port 6358
password "password"
db 1
key_prefix "caddy-certs"
value_prefix ""
timeout 5
tls_enabled "false"
tls_insecure "true"
}
}
3. The problem I’m having:
I want to log the content-length for the requests and responses that passes through Caddy, I would also like to log the time taken if possible.
I’ve been looking around the forum and documentation but haven’t seen a way to log any of these yet, I would really appreciate some assistance here, thanks!
4. Error messages and/or full log output:
N/A
5. What I already tried:
I’ve looked through the docs and searched the forum and Googled for a solution, haven’t seen one yet though