Skip to content

Access log vars#829

Open
nitrag wants to merge 2 commits intoemmett-framework:masterfrom
nitrag:access-log-vars
Open

Access log vars#829
nitrag wants to merge 2 commits intoemmett-framework:masterfrom
nitrag:access-log-vars

Conversation

@nitrag
Copy link
Copy Markdown

@nitrag nitrag commented Mar 26, 2026

Resolves #312

Adds the ability to implement UserAgent and custom request/response headers to the access log.

  • Add user_agent access log variable for logging the request User-Agent header
  • Add support for arbitrary request headers via %({Header-Name}i)s syntax (gunicorn-compatible)
  • Add support for arbitrary response headers via %({Header-Name}o)s syntax (gunicorn-compatible)
  • Validate access log format strings eagerly at startup to catch misconfiguration early
  • Response header capture overhead is gated behind a needs_resp_headers flag — zero cost when no %({...}o)s atoms are in the format string

@nitrag
Copy link
Copy Markdown
Author

nitrag commented Apr 2, 2026

@gi0baro ready for review, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support User-Agent header and response size atoms in Access Log

1 participant