Skip to content
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

feat(http-logger): add max request and response body size attributes #12065

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

Conversation

MariaLapovska
Copy link

Description

In some cases APISIX users might want to customize the max size of request/response body sent to HTTP server via http-logger plugin to be lower/higher than the current default value of 512KiB.
For this purpose two new attributes are introduced to http-logger plugin (similar to the existing ones in kafka-logger, taking advantage of the functionality that's already implemented in log-util):

  • max_resp_body_bytes
  • max_req_body_bytes

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • [] I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@MariaLapovska
Copy link
Author

Hi @shreemaan-abhishek!
I'm trying to add these attributes based on your PR - could you help me out with tests? I'm a complete newbie in Lua/Perl but we're using APISIX for our Java project and really need this functionality 😅

@Baoyuantop
Copy link
Contributor

Hi @MariaLapovska, are you currently experiencing any difficulties? Please describe in more detail so that others can help.

@MariaLapovska
Copy link
Author

@Baoyuantop I have added max_resp_body_bytes and max_req_body_bytes attributes for http-logger plugin (to be able to limit max request/response body size logged), following the example and reusing the logic that @shreemaan-abhishek has already implemented in this PR.
I am a Java dev, so I don't have enough expertise to write tests for this feature. Would it be possible for anyone to help me out with adding tests for logging large body via http-logger, same as the existing tests for kafka-logger?

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.

2 participants