tzssangglass commented on a change in pull request #5012:
URL: https://github.com/apache/apisix/pull/5012#discussion_r711094971
##########
File path: apisix/init.lua
##########
@@ -355,6 +356,8 @@ function _M.http_access_phase()
core.ctx.set_vars_meta(api_ctx)
+ debug.dynamic_debug()
Review comment:
done
##########
File path: docs/en/latest/architecture-design/debug-mode.md
##########
@@ -83,3 +83,25 @@ hook_phase: # Module Function List, Name: hook_phase
- http_log_phase
#END
```
+
+### Enable Advanced Debug Mode Dynamically
+
+The advanced debug mode can be enabled dynamically by a single request and
turned off automatically when the request ends.
Review comment:
done
##########
File path: docs/en/latest/architecture-design/debug-mode.md
##########
@@ -83,3 +83,25 @@ hook_phase: # Module Function List, Name: hook_phase
- http_log_phase
#END
```
+
+### Enable Advanced Debug Mode Dynamically
+
+The advanced debug mode can be enabled dynamically by a single request and
turned off automatically when the request ends.
+
+Example:
+
+```yaml
+http_filter:
+ enable: true # Enable/Disable Advanced Debug Mode Dynamically
+ enable_header_name: X-APISIX-Dynamic-Debug # Trace for the request with this
header
+......
+#END
+```
+
+Dynamically enable advanced debugging mode, example:
+
+```shell
+curl 127.0.0.1:9090/hello --header 'X-APISIX-Dynamic-Debug: foo'
+```
+
+Notice: Dynamic advanced debug mode cannot hook the `apisix.http_access_phase`
module (because the request enters the `apisix.http_access_phase` module before
it determines whether advanced debug mode is dynamically enabled).
Review comment:
done
--
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]