# Loggly Configuration

The `loggly` plugin sends gateway request and response logs to SolarWinds Loggly through HTTPS bulk delivery or RFC 5424 Syslog.<!-- --> <!-- -->Configuration covers plugin parameters and plugin metadata.

## Parameters[​](#parameters "Direct link to Parameters")

See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.

* customer\_token

  string

  required

  ***

  Loggly customer token. API7 Gateway encrypts the value with AES at rest. APISIX encrypts it before etcd storage when `apisix.data_encryption.enable_encrypt_fields` is enabled.

* tags

  array\[string]

  default: `[apisix]`

  ***

  Loggly tags sent with each event.

* severity

  string

  default: `INFO`

  valid value:

  `DEBUG`, `INFO`, `NOTICE`, `WARNING`, `ERR`, `CRIT`, `ALERT`, or the released literal `EMEGR` (case-insensitive)

  ***

  RFC 5424 severity used only with Syslog delivery.

* severity\_map

  object

  ***

  Mapping from three-digit HTTP status codes to Syslog severity values. Used only with Syslog delivery.

* ssl\_verify

  boolean

  default: `true`

  ***

  If true, verify the Loggly HTTPS certificate.

* log\_format

  object

  ***

  Custom log format. APISIX supports nesting up to five levels; API7 Gateway supports flat key-value structures.

* log\_format\_extra

  object

  ***

  Fields added to the default entry. Ignored when log\_format is configured.

* include\_req\_body

  boolean

  default: `false`

  ***

  Include a request body available to the logger. APISIX proactively reads it; in API7 Gateway a body not already buffered may be absent.

* include\_req\_body\_expr

  array\[array]

  valid value:

  at least one condition

  ***

  Conditions in [APISIX expression](https://docs.api7.ai/apisix/reference/apisix-expressions.md) format that control whether the default `request.body` field is included. In APISIX, they also control proactive body reading. Used only when `include_req_body` is true.

  A custom format that references `$request_body` can still include a body already buffered by NGINX when the conditions are false. Do not use this field as a data-redaction boundary.

* include\_resp\_body

  boolean

  default: `false`

  ***

  Include the response body in the log.

* include\_resp\_body\_expr

  array\[array]

  valid value:

  at least one condition

  ***

  Conditions in [APISIX expression](https://docs.api7.ai/apisix/reference/apisix-expressions.md) format that control when the response body is logged. Used only when `include_resp_body` is true.

* max\_req\_body\_bytes

  integer

  default: `524288`

  valid value:

  greater than or equal to 1

  ***

  Maximum request-body bytes included in the log.

* max\_resp\_body\_bytes

  integer

  default: `524288`

  valid value:

  greater than or equal to 1

  ***

  Maximum response-body bytes collected before decoding.

* name

  string

  default: `loggly`

  ***

  Batch-processor identifier exported in batch-processing metrics.

* batch\_max\_size

  integer

  default: `1000`

  valid value:

  greater than or equal to 1

  ***

  Maximum entries in one batch. A value of 1 sends each entry immediately; larger values buffer entries until a size or time limit is reached.

  HTTPS sends buffered entries as newline-separated bulk events. Syslog sends each entry as a separate UDP message.

  Batch processors are local to each gateway worker, so requests handled by different workers can be sent in separate batches.

* inactive\_timeout

  integer

  default: `5`

  valid value:

  greater than or equal to 1

  ***

  Seconds without a new entry before the current batch is sent. For timely flushing, set this value lower than `buffer_duration`.

* buffer\_duration

  integer

  default: `60`

  valid value:

  greater than or equal to 1

  ***

  Maximum age in seconds of the oldest entry before a batch is sent.

* retry\_delay

  integer

  default: `1`

  valid value:

  greater than or equal to 0

  ***

  Seconds between failed send attempts.

* max\_retry\_count

  integer

  default: `0`

  valid value:

  greater than or equal to 0

  ***

  Failed retries allowed before a batch is dropped.

## Plugin Metadata[​](#plugin-metadata "Direct link to Plugin Metadata")

The following attributes configure shared Loggly delivery settings through [plugin metadata](https://docs.api7.ai/apisix/key-concepts/plugin-metadata.md).

* host

  string

  default: `logs-01.loggly.com`

  ***

  Loggly delivery host.

* port

  integer

  default: `514`

  ***

  UDP destination port used for Syslog delivery. HTTP and HTTPS ignore this field; include a non-default port in `host` instead.

* protocol

  string

  default: `syslog`

  valid value:

  `syslog`, `http`, or `https`

  ***

  Delivery protocol. Syslog uses UDP; HTTP and HTTPS use Loggly's bulk endpoint.

* timeout

  integer

  default: `5000`

  valid value:

  greater than or equal to 1

  ***

  Delivery timeout in milliseconds.

* log\_format

  object

  ***

  Default custom format for plugin instances.

* log\_format\_extra

  object

  ***

  Default extra fields for plugin instances.

* max\_pending\_entries

  integer

  default: `8192`

  valid value:

  greater than or equal to 1

  ***

  Maximum number of entries waiting in the batch processor. New entries are discarded when the backlog reaches the limit.

  Introduced with a default of `8192` in API7 Enterprise 3.9.19 and 3.10.6, and in APISIX 3.18.0. Earlier versions do not support this field.

  See [Batch Processor](https://docs.api7.ai/apisix/reference/batch-processor.md#configure-the-pending-entry-limit) for sizing and verification guidance.
