DEBUG log and list of headers

1. Caddy version (caddy version):

v2.1.0-beta.1 h1:nG+Y2NuoqGvJEnHlVO5PXtTxuc2yHsjr2nU+dJ5yETk=

2. How I run Caddy:

sudo /home/xx/bin/caddy run -config /home/xx/.config/xx/Caddyfile >> /home/xx/logs/caddy.out 2>&1&

a. System environment:

Linux next.col.end 5.6.19-300.fc32.x86_64 #1 SMP Wed Jun 17 16:10:48 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Fedora Server 32

d. My complete Caddyfile or JSON config:

n.app.xx.com {
	
	bind 192.168.10.199
	root * /home/xx/srv/n/webui/
    	# api-server proxy
	reverse_proxy /api/v2/* http://192.168.11.11:8883
	# auth-server proxy
	reverse_proxy /auth/v1/* http://localhost:8886
	file_server
	
	log {
		level DEBUG
        output file /home/xx/logs/n/app.log {
            roll_size     100MiB
            roll_keep     10
            roll_keep_for 2160h
            }
        format logfmt
	}
}

3. The problem I’m having:

How do I enable debug information in my log file… DEBUG seams not working?
How do I list all headers for the request in the log file?

I have double proxy setup… My firewall (F5 BigIP) forwards all HTTP requests to Caddy and then Caddy proxies to local API service. My firewall actually inserts X-Forwarded-For to all requests, but I cannot see it in my API service. Any solution for that?

Thank you,
Luke

Hey Luke,

logfmt unfortunately does not support access logs very well because it only does key=value, not any nesting (even though in theory it could flatten it out, it doesn’t). So I am thinking of deprecating that and removing it in the future. Just use another log format.

(Enabling debug mode on access logs won’t do anything btw, since access logs are all info level.)

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.