Skip to main content

Module error_log_logger

Module error_log_logger 

Source
Expand description

The error-log-logger node — a reinterpreted subset of APISIX’s error-log-logger plugin.

In APISIX this plugin tails Nginx’s internal error-log stream (via ngx.errlog) and forwards those lines to a remote sink. featherbit has no separate internal error-log stream to tail, so the faithful reinterpretation is an error-only access logger: it builds the shared access-log entry and ships it to a remote TCP sink only when the request accumulated errors (context.errors is non-empty). Requests that succeed produce nothing.

Entries are buffered in a BatchSink and delivered by a background task that opens a fresh [tokio::net::TcpStream] per flush and writes each entry as one newline-delimited JSON object. Delivery is fire-and-forget on the request path, so place this node in the response pipeline after the upstream node (and after any node whose errors you want captured).

§Deviations from APISIX

  • Source of logs: featherbit logs request-level errors (context.errors) rather than the gateway’s own internal error-log lines.
  • Only the tcp sink (host/port) is implemented; the skywalking, clickhouse, and kafka sinks are out of scope for this socket-focused node.
  • level is accepted for compatibility but featherbit filters on the presence of request errors, not on a syslog severity threshold.
  • tls is not yet supported; tls: true is rejected at config load.

Structs§

ErrorLogLoggerPlugin
The error-log-logger plugin node.
TcpFlusher 🔒
BatchFlusher that connects to host:port and writes the batch.

Functions§

entries_to_lines 🔒
Serializes each entry as one line of JSON, newline-terminated. Pure helper.