Skip to content

fix: only log response body when include_resp_body is enabled#12599

Merged
LiteSun merged 3 commits into
apache:masterfrom
LiteSun:fix-logger
Sep 9, 2025
Merged

fix: only log response body when include_resp_body is enabled#12599
LiteSun merged 3 commits into
apache:masterfrom
LiteSun:fix-logger

Conversation

@LiteSun

@LiteSun LiteSun commented Sep 8, 2025

Copy link
Copy Markdown
Member

Description

This PR fixes an issue where, when both file-logger and http-logger plugins are configured on the same route, enabling include_resp_body in file-logger would also cause http-logger to log the response body, even if include_resp_body was disabled for http-logger.

Which issue(s) this PR fixes:

fix #12537

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)

@LiteSun
LiteSun marked this pull request as ready for review September 8, 2025 08:28
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Sep 8, 2025
AlinsRan
AlinsRan previously approved these changes Sep 8, 2025
Comment thread apisix/utils/log-util.lua Outdated
@LiteSun
LiteSun requested review from AlinsRan and nic-6443 September 9, 2025 03:09
@LiteSun
LiteSun merged commit 7cbf8ee into apache:master Sep 9, 2025
23 checks passed
@LiteSun
LiteSun deleted the fix-logger branch September 9, 2025 09:05
jizhuozhi pushed a commit to jizhuozhi/apisix that referenced this pull request Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: The http-logger plugin has 'include_resp_body' set to false, but the response body still appears in the response.

4 participants