loggly

When the Plugin is enabled, APISIX will serialize the request context information to Loggly Syslog data format which is Syslog events with compliant headers.

When the maximum batch size is exceeded, the data in the queue is pushed to Loggly enterprise syslog endpoint. See batch processor for more details.

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.

You can also configure the Plugin through Plugin metadata. The following configurations are available:

NameTypeRequiredDefaultValid valuesDescription
hoststringFalse“logs-01.loggly.com”Endpoint of the host where the logs are being sent.
portintegerFalse514Loggly port to connect to. Only used for syslog protocol.
timeoutintegerFalse5000Loggly send data request timeout in milliseconds.
protocolstringFalse“syslog”[ “syslog” , “http”, “https” ]Protocol in which the logs are sent to Loggly.
log_formatobjectFalsenilLog format declared as key value pairs in JSON format. Values only support strings. APISIX or variables can be used by prefixing the string with $.

We support Syslog, (bulk endpoint) protocols to send log events to Loggly. By default, in APISIX side, the protocol is set to “syslog”. It lets you send RFC5424 compliant syslog events with some fine-grained control (log severity mapping based on upstream HTTP response code). But HTTP/S bulk endpoint is great to send larger batches of log events with faster transmission speed. If you wish to update it, just update the metadata.

note

APISIX supports and HTTP/S protocols to send data to Loggly. Syslog lets you send RFC5424 compliant syslog events with fine-grained control. But, HTTP/S bulk endpoint is better while sending large batches of logs at a fast transmission speed. You can configure the metadata to update the protocol as shown below:

Enabling the Plugin

Minimal configuration

The example below shows a bare minimum configuration of the Plugin on a Route:

Now, if you make a request to APISIX, it will be logged in Loggly:

You can then view the logs on your Loggly Dashboard:

Disable Plugin

To disable the Plugin, you can delete the corresponding JSON configuration from the Plugin configuration. APISIX will automatically reload and you do not have to restart for this to take effect.