Skip to content

fix: do not consume request body unless explicitly requested #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

techfg
Copy link

@techfg techfg commented Jun 27, 2025

Add a new option LogAdditionalAttrs and deprecates LogExtraAttrs:

  1. Adds LogAdditionalAttrsOptions.IncludeRequestBody to provide control over when request body is consumed and passed to LogAdditionalAttrsOptions.AdditionalAttrs. The default is false (vs. LogExtraAttrs which would always consume the entire body) which could lead to high memory usage even when not needed
  2. Passes LogDetails to LogAdditionalAttrsOptions.AdditionalAttrs which contains the same params as LogExtraAttrs does but supports extending additional details if/when needed to avoid breaking changes moving forward

The approach taken is not a breaking change, however if desired, the implementation can be simplified which would result in a breaking change and a major bump.

Resolves #62

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.

high memory usage when using LogExtraAttrs
1 participant