• Meaning 1: ◦ Append-only data structure ◦ In Kafka, stored in ${log.dirs}, ${log.dir} • Meaning 2: ◦ A file that records the events occur in the system internals. ◦ In Kafka, stored in ${kafka.logs.dir} • We will focus on meaning 2 only in this talk.
What to monitor? ◦ How to manage it? • Logging in Kafka Connect ◦ What to monitor? ◦ How to manage it? • Upcoming: Log4j2 (Preview) ◦ Differences? ◦ How to activate it?
Kafka requests. ◦ Default: ${kafka.logs.dir}/kafka-request.log • kafka.server.KafkaApis ◦ Handles various Kafka requests. ◦ Not defined in the default logging configuration. • kafka.log.LogCleaner ◦ Log Compaction, Retention, etc. ◦ Default: ${kafka.logs.dir}/log-cleaner.log
the log configuration & restarting? ◦ A squad of brokers? ◦ Kubernetes pods? • We need to configure the log settings dynamically! • Alternatives ◦ Method 1: Use JMX Console ◦ Method 2: Use Command Line Tool (kafka-configs.sh) ▪ … or Admin API
1: Use JMX Console ◦ You can change the logger’s logging level dynamically with JMX bean. ◦ Similar Features: Apache Storm, Apache Zookeeper • How to use it?
Configuration API was updated in 2.3.0 ◦ Admin#incrementalAlterConfigs ◦ KIP-339: Create a new IncrementalAlterConfigs API ◦ KIP-412: Extend Admin API to support dynamic application log levels • Before use this tool, please update the installation first.
messages are mixed in one log file. ◦ ${kafka.logs.dir}/connect.log ◦ How can I separate the logging messages I need…? ◦ Like, the log messages from a specific task. • KIP-449: Add connector contexts to Connect worker logs ◦ From 2.3.0 ◦ Provides Logging Context
current loggers with corresponding levels ◦ GET to http://{kafka-connect-host}:8083/admin/loggers • Example $ curl -s http://{kafka-connect-host}:8083/admin/loggers { "org.apache.kafka.connect.runtime.rest": { "level": "WARN" }, ... }
2012 (1.2.17) ◦ Obsolete Configuration Syntax ◦ Security Problems ▪ CVE-2019-17571: SocketServer Vulnerability ◦ Problem: Kafka is still using it. ▪ Only Log4j 1.x to Kafka is supported. • Log4j 2.x: current de-facto standard ◦ Will be adopted to Apache Kafka > 2.7.0 ▪ KIP-676: Respect logging hierarchy (Bug Fix) ▪ KIP-653: Upgrade log4j to log4j2
use the feature? ◦ Public Beta will be provided soon. ▪ 2.7.0+log4j2, 2.6.1+log4j2, etc. ▪ with English, Korean documentation. • Question 2: When log4j2 configuration will be default? ◦ Not Decided Yet. • Question 3: What about Log4j2 Appender? ◦ Working in Progress.
◦ JMX Console ◦ Command Line Tool • You can manager Kafka Connects’ log with… ◦ Rest API • Kafka will migrate into log4j2 ◦ With Backward-compatibility!