Skip to main content

librdkafka Logging

The Kafka asset uses the @confluentinc/kafka-javascript client which in turn uses librdkafka. librdkafka has its own logging system that operates independently of Teraslice's logger and can be configured through rdkafka_options on any Kafka API.

Settings

debug

Enables verbose debug logging for specific librdkafka subsystems. Accepts a comma-separated string of context names.

ContextDescription
genericGeneric client logging
brokerBroker connection events
topicTopic and partition metadata
metadataMetadata requests and responses
featureFeature negotiation with brokers
queueInternal message queues
msgMessage production and consumption
protocolKafka protocol framing
cgrpConsumer group coordination
securitySSL/SASL authentication
fetchFetch request details
interceptorInterceptor plugin events
pluginPlugin loading
consumerConsumer-level events
adminAdmin client operations
eosExactly-once semantics (idempotent producer)
mockMock cluster events
assignorPartition assignor
confConfiguration dump at client creation
allAll of the above

log_level

Controls the severity threshold for librdkafka's internal log output. Uses standard syslog severity levels.

ValueLevelDescription
0EMERGSystem is unusable
1ALERTAction must be taken immediately
2CRITCritical conditions
3ERRError conditions
4WARNINGWarning conditions
5NOTICENormal but significant conditions
6INFOInformational messages (default)
7DEBUGDebug-level messages

The default is 6 (INFO). Set to 7 to see all debug output from librdkafka.

Usage

Both settings are passed through rdkafka_options in the API or operation config.

Enable full debug logging

{
"_name": "kafka_reader_api",
"topic": "my-topic",
"group": "my-group",
"rdkafka_options": {
"log_level": 7,
"debug": "all"
}
}

Debug only broker connections and consumer group coordination

{
"_name": "kafka_sender_api",
"topic": "my-topic",
"rdkafka_options": {
"log_level": 7,
"debug": "broker,cgrp"
}
}

Suppress all but critical errors

{
"_name": "kafka_reader_api",
"topic": "my-topic",
"group": "my-group",
"rdkafka_options": {
"log_level": 2
}
}

Notes

  • librdkafka log events are emitted via the client's event emitter and forwarded to Teraslice's bunyan logger at the info level.
  • debug: "all" is very verbose and should only be used for troubleshooting. Avoid it in production.
  • The conf debug context logs all resolved configuration values at startup, which is useful for verifying that settings are being applied as expected.
  • API level rdkafka_options have the highest priority in the Configuration Hierarchy, so these settings will override any connector-level defaults.