You are not logged in.
I'm setting up a Caddy webserver and I've an issue with the access log. Lines in the acces log are prefixed with date and time. And I'm not able to remove them.
Example Caddy config:
*:80 {
root /srv/http
log /var/log/caddy/access.log
errors /var/log/caddy/error.log
}
The access.log should fill with lines like this:
10.102.2.100 - - [06/Feb/2020:15:25:20 +0100] "GET / HTTP/1.1" 200 0
But instead I get:
2020/02/06 15:25:20 10.102.2.100 - - [06/Feb/2020:15:25:20 +0100] "GET / HTTP/1.1" 200 0
So I modified the log line in the configuration to:
log / /var/log/caddy/access.log "{common}"
But this doesn't change anything.
I want a common access.log without date/time prefix. How to fix?
Last edited by bart (2020-02-07 15:40:47)
Offline
Just figured out that recent versions of Caddy have a new flag to disable these timestamps: -log-timestamps=false
Fix: /etc/systemd/system/caddy.service.d/override.conf
[Service]
ExecStart=
ExecStart=/usr/bin/caddy -log-timestamps=false -log stdout -agree -conf /etc/caddy/caddy.conf -root=/usr/share/caddy
Now the access log is in plain old common format.
The next plan is to make my DIY access log processing software a bit more flexible, since these timestamps are kind of useful.
Offline