You are not logged in.

#1 2020-02-06 14:29:59

Registered: 2007-07-12
Posts: 10

[SOLVED] Caddy access log prefix

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: - - [06/Feb/2020:15:25:20 +0100] "GET / HTTP/1.1" 200 0

But instead I get:

2020/02/06 15:25:20 - - [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)


#2 2020-02-07 15:40:24

Registered: 2007-07-12
Posts: 10

Re: [SOLVED] Caddy access log prefix

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

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.


Board footer

Powered by FluxBB