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
See plugin common configurations for configuration options available to all plugins.
There are no parameters for this plugin to be configured on routes or services.
Plugin Metadata
tcp
TCP server configurations.
host
IP address or the hostname of the TCP server.
port
valid value:
greater than or equal to 0Target upstream port.
tls
If true, encrypt the TCP connection with TLS. The receiver's certificate is not verified.
tls_server_name
Server name sent through the TLS Server Name Indication (SNI) extension when
tcp.tlsistrue. This does not enable certificate verification.
skywalking
Skywalking server configurations.
endpoint_addr
Address of the SkyWalking server.
service_name
Service name for the SkyWalking reporter.
service_instance_name
Service instance name for the SkyWalking reporter. Set to
$hostnameto get the local hostname.
clickhouse
ClickHouse server configurations. Supply all subfields when this block is configured.
endpoint_addr
ClickHouse endpoint.
user
ClickHouse username.
password
ClickHouse password.
The password is encrypted with AES before being stored in etcd.
database
Name of the database to store the logs.
logtable
Table name to store the logs. The table should have a
datacolumn where the plugin will push logs to.
kafka
Kafka server configurations.
brokers
valid value:
greater than 0List of Kafka broker nodes.
host
The host of Kafka broker.
port
The port of Kafka broker.
sasl_config
The SASL configuration of Kafka broker
mechanism
valid value:
PLAINThe mechanism of SASL configuration.
user
The user of SASL configuration.
password
Password for the Kafka SASL configuration. The value is encrypted before storage when data encryption is enabled.
tls
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
If true, verify the Kafka broker's TLS certificate against the configured trusted CA store. The default is
false, so enablingtlsencrypts the connection but does not authenticate the broker. Set it totruein production.
kafka_topic
Target topic to push the logs for organization.
producer_type
valid value:
asyncorsyncTarget topic to push the logs for organization.
required_acks
valid value:
-1, 0, or 1Number 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 for more information.
key
Key used for allocating partitions for messages.
cluster_name
valid value:
greater than or equal to 1Name of the cluster. Used when there are two or more Kafka clusters. Only works if
producer_typeis set toasync.meta_refresh_interval
valid value:
greater than or equal to 1Time interval to auto refresh the metadata. Same as the
refresh_intervalparameter in lua-resty-kafka, but in seconds.
timeout
valid value:
greater than 0Timeout in seconds for connecting to the configured logging service and sending data.
keepalive
valid value:
greater than or equal to 1Time to keep the connection alive after sending data, in seconds.
level
valid value:
STDERR,EMERG,ALERT,CRIT,ERR,ERROR,WARN,NOTICE,INFO, orDEBUGSeverity level to filter the error logs. Note that
ERRis the same asERROR.name
Unique identifier of the plugin for the batch processor. If you use Prometheus to monitor APISIX metrics, the name is exported in
apisix_batch_process_entries.batch_max_size
valid value:
greater than 0The 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
valid value:
greater than 0The 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
valid value:
greater than 0The maximum time in seconds from the earliest entry allowed before sending the batch to the logging service.
retry_delay
valid value:
greater than or equal to 0The time interval in seconds to retry sending the batch to the logging service if the batch was not successfully sent.
max_retry_count
valid value:
greater than or equal to 0The maximum number of unsuccessful retries allowed before dropping the log entries.