# Error Log Logger Configuration

The `error-log-logger` plugin forwards error logs in batches to TCP, Apache SkyWalking, Apache Kafka, or ClickHouse servers, with severity filtering.<!-- --> <!-- -->Configuration covers 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.

There are no parameters for this plugin to be configured on routes or services.

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

* tcp

  object

  ***

  TCP server configurations.

  * host

    string

    required

    ***

    IP address or the hostname of the TCP server.

  * port

    integer

    required

    valid value:

    greater than or equal to 0

    ***

    Target upstream port.

  * tls

    boolean

    default: `false`

    ***

    If true, encrypt the TCP connection with TLS. The receiver's certificate is not verified.

  * tls\_server\_name

    string

    ***

    Server name sent through the TLS Server Name Indication (SNI) extension when `tcp.tls` is `true`. This does not enable certificate verification.

* skywalking

  object

  ***

  Skywalking server configurations.

  * endpoint\_addr

    string

    default: `http://127.0.0.1:12900/v3/logs`

    ***

    Address of the SkyWalking server.

  * service\_name

    string

    default: `APISIX`

    ***

    Service name for the SkyWalking reporter.

  * service\_instance\_name

    string

    default: `APISIX Service Instance`

    ***

    Service instance name for the SkyWalking reporter. Set to `$hostname` to get the local hostname.

* clickhouse

  object

  ***

  ClickHouse server configurations. Supply all subfields when this block is configured.

  * endpoint\_addr

    string

    required

    default: `http://127.0.0.1:8123`

    ***

    ClickHouse endpoint.

  * user

    string

    required

    default: `default`

    ***

    ClickHouse username.

  * password

    string

    required

    ***

    ClickHouse password.

    The password is encrypted with AES before being stored in etcd.

  * database

    string

    required

    ***

    Name of the database to store the logs.

  * logtable

    string

    required

    ***

    Table name to store the logs. The table should have a `data` column where the plugin will push logs to.

* kafka

  object

  ***

  Kafka server configurations.

  * brokers

    array

    required

    valid value:

    greater than 0

    ***

    List of Kafka broker nodes.

    * host

      string

      required

      ***

      The host of Kafka broker.

    * port

      integer

      required

      ***

      The port of Kafka broker.

    * sasl\_config

      object

      ***

      The SASL configuration of Kafka broker

      * mechanism

        string

        default: `PLAIN`

        valid value:

        `PLAIN`

        ***

        The mechanism of SASL configuration.

      * user

        string

        required

        ***

        The user of SASL configuration.

      * password

        string

        required

        ***

        Password for the Kafka SASL configuration. The value is [encrypted before storage](https://docs.api7.ai/apisix/production/security/data-encryption-with-keyring.md) when data encryption is enabled.

  * tls

    object

    ***

    TLS configuration for connecting to Kafka brokers. Setting this object makes the plugin connect over TLS; omit it to connect in plaintext. Introduced in APISIX 3.18.0.

    * verify

      boolean

      default: `false`

      ***

      If true, verify the Kafka broker's TLS certificate against the configured trusted CA store. The default is `false`, so enabling `tls` encrypts the connection but does not authenticate the broker. Set it to `true` in production.

  * kafka\_topic

    string

    required

    ***

    Target topic to push the logs for organization.

  * producer\_type

    string

    default: `async`

    valid value:

    `async` or `sync`

    ***

    Target topic to push the logs for organization.

  * required\_acks

    integer

    default: `1`

    valid value:

    -1, 0, or 1

    ***

    Number of acknowledgements the leader needs to receive for the producer to consider the request complete. This controls the durability of the sent records. See [Kafka documentation](https://kafka.apache.org/documentation/#producerconfigs_acks) for more information.

  * key

    string

    ***

    Key used for allocating partitions for messages.

  * cluster\_name

    integer

    default: `1`

    valid value:

    greater than or equal to 1

    ***

    Name of the cluster. Used when there are two or more Kafka clusters. Only works if `producer_type` is set to `async`.

  * meta\_refresh\_interval

    integer

    default: `30`

    valid value:

    greater than or equal to 1

    ***

    Time interval to auto refresh the metadata. Same as the `refresh_interval` parameter in [lua-resty-kafka](https://github.com/doujiang24/lua-resty-kafka), but in seconds.

* timeout

  integer

  default: `3`

  valid value:

  greater than 0

  ***

  Timeout in seconds for connecting to the configured logging service and sending data.

* keepalive

  integer

  default: `30`

  valid value:

  greater than or equal to 1

  ***

  Time to keep the connection alive after sending data, in seconds.

* level

  string

  default: `WARN`

  valid value:

  `STDERR`, `EMERG`, `ALERT`, `CRIT`, `ERR`, `ERROR`, `WARN`, `NOTICE`, `INFO`, or `DEBUG`

  ***

  Severity level to filter the error logs. Note that `ERR` is the same as `ERROR`.

* name

  string

  default: `error-log-logger`

  ***

  Unique identifier of the plugin for the batch processor. If you use [Prometheus](https://docs.api7.ai/hub/prometheus.md) to monitor APISIX metrics, the name is exported in `apisix_batch_process_entries`.

* batch\_max\_size

  integer

  default: `1000`

  valid value:

  greater than 0

  ***

  The number of log entries allowed in one batch. Once reached, the batch will be sent to the configured logging service. Setting this parameter to 1 means immediate processing.

* inactive\_timeout

  integer

  default: `3`

  valid value:

  greater than 0

  ***

  The maximum time in seconds to wait for new logs before sending the batch to the logging service. The value should be smaller than `buffer_duration`.

* buffer\_duration

  integer

  default: `60`

  valid value:

  greater than 0

  ***

  The maximum time in seconds from the earliest entry allowed before sending the batch to the logging service.

* retry\_delay

  integer

  default: `1`

  valid value:

  greater than or equal to 0

  ***

  The time interval in seconds to retry sending the batch to the logging service if the batch was not successfully sent.

* max\_retry\_count

  integer

  default: `0`

  valid value:

  greater than or equal to 0

  ***

  The maximum number of unsuccessful retries allowed before dropping the log entries.
