syslog

Logs can be set as JSON objects.

Attributes

This Plugin supports using batch processors to aggregate and process entries (logs/data) in a batch. This avoids the need for frequently submitting the data. The batch processor submits data every 5 seconds or when the data in the queue reaches 1000. See Batch Processor for more information or setting your custom configuration.

NameTypeRequiredDefaultDescription
log_formatobjectFalse{“host”: “$host”, “@timestamp”: “$time_iso8601”, “client_ip”: “$remote_addr”}Log format declared as key value pairs in JSON format. Values only support strings. APISIX or variables can be used by prefixing the string with .
IMPORTANT

Configuring the Plugin metadata is global in scope. This means that it will take effect on all Routes and Services which use the syslog Plugin.

The example below shows how you can configure through the Admin API:

Enabling the Plugin

The example below shows how you can enable the Plugin for a specific Route:

Now, if you make a request to APISIX, it will be logged in your Syslog server:

Disable Plugin