Skip to content

high memory usage when using LogExtraAttrs #62

@techfg

Description

@techfg

When using LogExtraAttrs to add additional attributes to the log, the reqBody is passed as a string parameter. In the case of large request bodies, for example, file uploads, this can lead to high memory usage.

Additionally, in situations where reqBody isn't accessed within LogExtraAttrs, there is unnecessary processing overhead introduced with TeeReader.

Possibly adding an alternate callback for adding attributes to the log that doesn't involve the request body, and/or a way to opt-in/out of having access to the reqBody?

Would solicit input on the preferred approach to implement, but happy to submit a PR if there is an appetite to address this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions