Debug mode
You can enable the basic debug mode by adding this line to your debug configuration file ():
conf/debug.yaml
note
For APISIX releases prior to v2.10, basic debug mode is enabled by setting apisix.enable_debug = true
in your configuration file (conf/config.yaml
).
If you have configured two Plgins limit-conn
and limit-count
on the Route /hello
, you will receive a response with the header Apisix-Plugins: limit-conn, limit-count
when you enable the basic debug mode.
IMPORTANT
Advanced debug mode
You can configure advanced options in debug mode by modifying your debug configuration file (conf/debug.yaml
).
The following configurations are available:
note
A checker would check every second for changes to the configuration file. It will only check a file if the file was updated based on its last modification time.
You can add an #END
flag to indicate to the checker to only look for changes until that point.
conf/debug.yaml
hook_conf:
enable: false # Enables/disables hook debug trace
name: hook_phase # Module list name of the hook that enabled the debug trace
log_level: warn # Log level for input arguments & returned values
is_print_input_args: true # When set to `true` enables printing input arguments
is_print_return_value: true # When set to `true` enables printing returned values
apisix: # Referenced module name
- http_access_phase # Function names:Array
- http_header_filter_phase
- http_body_filter_phase
- http_log_phase
#END
You can also enable advanced debug mode only on particular requests.
The example below shows how you can enable it on requests with the header X-APISIX-Dynamic-Debug
:
conf/debug.yaml
curl 127.0.0.1:9090/hello --header 'X-APISIX-Dynamic-Debug: foo'
note
The apisix.http_access_phase
module cannot be hooked for this dynamic rule as the advanced debug mode is enabled based on the request.