1. The problem I’m having:
If I use unaltered logging output via output file caddy.log, the output looks okay but I want to apply formatting params:
time_format wall
time_local
This is where the problem starts. I was able to get these params to work except I had to go thru format encoder, like:
log caddy-log {
output file caddy.log
format console {
time_format wall
time_local
}
}
but I don’t want to format the console per se, I just want to edit the field values. When I do the above, I get some trash (that I don’t get when not using any formatting), e.g.:
2023/07/22 18:26:07 e[34mINFOe[0m tls.cache.maintenance started background certificate maintenance {"cache": "0xc00021c8c0"}
So, is there a way to apply the field value changes w/o having to format the console?
2. Error messages and/or full log output:
n/a
3. Caddy version:
2.6.4
4. How I installed and ran Caddy:
a. System environment:
Win10 Pro x64
b. Command:
caddy run
d. My complete Caddy config:
(as it is now, until I get the log formatting worked out)
{
email myemail@email.net
default_sni justinsdomain.com
servers :8443 {
protocols h2 h1
}
#log stdout
log caddy-log {
output file caddy.log
}
}
(headers) {
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains;"
X-Xss-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
X-Frame-Options "SAMEORIGIN"
Content-Security-Policy "upgrade-insecure-requests"
Referrer-Policy "strict-origin-when-cross-origin"
Cache-Control "public, max-age=15, must-revalidate"
}
}
(logging) {
log {
output file "{args.0}.log"
}
}
#file server 1
serv1.justinsdomain.com:8443 {
log {
output file caddy-Serv1.log
}
reverse_proxy :8080
encode zstd gzip
import headers
}
#file server 2
serv2.justinsdomain.com:8443 {
import logging Serv2
reverse_proxy :8081
encode zstd gzip
import headers
}