spacewander commented on code in PR #8711: URL: https://github.com/apache/apisix/pull/8711#discussion_r1089879456
########## t/plugin/file-logger3.t: ########## @@ -0,0 +1,124 @@ +# Review Comment: Could we move these tests under https://github.com/apache/apisix/blob/master/t/plugin/file-logger2.t? ########## apisix/plugins/file-logger.lua: ########## @@ -59,6 +59,9 @@ local _M = { metadata_schema = metadata_schema } +core.ctx.register_var("resp_body", function(ctx) Review Comment: Would be better to put it in https://github.com/apache/apisix/blob/master/apisix/core/ctx.lua so other loggers can use it too. ########## docs/en/latest/plugins/file-logger.md: ########## @@ -43,10 +43,10 @@ The `file-logger` Plugin is used to push log streams to a specific location. ## Attributes -| Name | Type | Required | Description | -| ---- | ------ | -------- | ------------- | +| Name | Type | Required | Description | +| ---- | ------ | -------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | path | string | True | Log file path. | -| include_resp_body | boolean | False | When set to `true` includes the response body in the log file. | +| include_resp_body | boolean | False | When set to `true` includes the response body in the log file. If format is set, you can use the variable $resp_body to get the response body. | Review Comment: Would be better to put it in https://github.com/apache/apisix/blob/master/docs/en/latest/apisix-variable.md, instead of modifying each logger's doc. Note that we need to mean that this variable is only for logger and requires the logger to have a special configuration. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
