Skip to content

Access log vars - #829

Merged
gi0baro merged 5 commits into
emmett-framework:masterfrom
nitrag:access-log-vars
Aug 3, 2026
Merged

Access log vars#829
gi0baro merged 5 commits into
emmett-framework:masterfrom
nitrag:access-log-vars

Conversation

@nitrag

@nitrag nitrag commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Refers to #312

Add support for arbitrary request headers in access log via %(header{Header-Name})s atom

@nitrag

nitrag commented Apr 2, 2026

Copy link
Copy Markdown
Contributor Author

@gi0baro ready for review, thanks

@yeongzhiwei

Copy link
Copy Markdown

hi @gi0baro , I would also love to have this feature to put it on parity with gunicorn. any progress on this MR?

@nalundgaard

Copy link
Copy Markdown

@nitrag does this address the BodyLength part of the request? It looks like that is not present in granian.

@nitrag

nitrag commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

@nalundgaard I believe there was additional overhead with adding body/content length, so I removed it. I'm hoping this PR is low enough impact so it has higher chance of being merged.

@gi0baro

@gi0baro

gi0baro commented May 15, 2026

Copy link
Copy Markdown
Member

Hey all, please stop pinging me.
If I leave a PR open and don't reject it, it doesn't mean I won't merge it.

A lot happened in my personal life in the past few months – and even if this wasn't the case – give me the time to appropriately review stuff.
When I'll be able to review this, I'll do.

@gi0baro gi0baro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I refactored this, specifically:

  • dropped response headers entirely, too much complexity added for a limited use-case
  • use %(header{Header-Name})s as the atom, every other atom is not compatible with Gunicorn, thus no reason to use the same fmt just for this one
  • removed user-agent as a special case, it's an header like everything else
  • split all the code paths for header vs non-header cases
  • dropped tests, I don't see the value gain on an already slow suite
  • updated README accordingly

@gi0baro gi0baro added this to the 2.8 milestone Aug 3, 2026
@gi0baro
gi0baro merged commit a3bc23c into emmett-framework:master Aug 3, 2026
1 of 26 checks passed
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.

4 participants