http-logger
This will provide the ability to send Log data requests as JSON objects to Monitoring tools and other HTTP servers.
Attributes
The following is an example of how to enable the http-logger
for a specific route. You could generate a mock HTTP server at to view the logs.
Test Plugin
Name | Type | Requirement | Default | Valid | Description |
---|---|---|---|---|---|
log_format | object | optional | {“host”: “$host”, “@timestamp”: “$time_iso8601”, “client_ip”: “$remote_addr”} | Log format declared as key value pair in JSON format. Only string is supported in the value part. If the value starts with , it means to get APISIX variable or . |
Note that the metadata configuration is applied in global scope, which means it will take effect on all Route or Service which use http-logger plugin.
Disable Plugin
Remove the corresponding json configuration in the plugin configuration to disable the http-logger
. APISIX plugins are hot-reloaded, therefore no need to restart APISIX.