How to add upstream server ip into access logs

1. The problem I’m having:

How to add upstream server ip into access logs.

When caddy acts as a multi-backend servers proxy, the caddy log does not include the specific server to which the request is distributed.

2. Error messages and/or full log output:

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

3. Caddy version:

caddy v2.6.4

4. How I installed and ran Caddy:

a. System environment:

ubuntu 22.04

It’s not currently possible to augment the access logs arbitrarily, but it’s something we’re thinking about.

You can enable the debug global option which will show which upstream is being chosen for each request, but it doesn’t touch the access logs in particular.

2 Likes

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