Skip to content

Include http.request.uuid field in access logs? #5820

@sleeyax

Description

@sleeyax

I have a reverse proxy setup and I'm trying to 'link' access logs to upstream server events. What I've got so far is the following Caddy file:

localhost {
	reverse_proxy {
		to https://localhost:5000
		header_up X-Request-Id "{http.request.uuid}"
		transport http {
			tls
			tls_insecure_skip_verify
			read_buffer 8192
		}
	}
	log {
		level info
		# somehow include an additional field {..., requestId: "{http.request.uuid}"} in the log?
	}
}

The HTTP server at https://localhost:5000 can read the incoming X-Request-Id header just fine. But how can I write the same request ID to the access log to link them together (for deeper analysis in case of upstream server errors)?

Perhaps someone knows a work-around for this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions