Skip to main content
Version: 1.2-beta

Kafka Log

Collect the log information from the request gateway and output it to Kafka, making it convenient for users to perform secondary operations, such as log analysis.

Features

Enables the output of log content generated during the program's operation to a specified Kafka cluster queue.

Operation Demonstration

Create a New Kafka Log Configuration

  1. Click Operations and Integration -> Kafka Log, and then click Add Kafka Log.

  1. Fill in the Kafka log configuration, and click save after completing.

Configuration Description:

Field NameDescription
VersionKafka version
Server AddressKafka service address, multiple addresses separated by commas
TopicKafka service Topic information
Partition TypeMethod of choosing partition, default is hash. When choosing hash, if partition_key is empty, random selection is used
PartitionWhen Partition Type is manual, this specifies the partition number
Partition KeyWhen Partition Type is hash, this specifies the hash value
Request TimeoutTimeout duration, in seconds
Output FormatThe format of output log content, supports single-line, JSON format output
Formatting ConfigurationOutput format template, for configuration tutorial click here to jump

Example Formatting Configuration

{
"fields": [
"$time_iso8601",
"$request_id",
"@request",
"@proxy",
"@response",
"@status_code",
"@time"
],
"request": [
"$request_method",
"$scheme",
"$request_uri",
"$host",
"$header",
"$remote_addr"
],
"proxy": [
"$proxy_method",
"$proxy_scheme",
"$proxy_uri",
"$proxy_host",
"$proxy_header",
"$proxy_addr"
],
"response": [
"$response_headers"
],
"status_code": [
"$status",
"$proxy_status"
],
"time": [
"$request_time",
"$response_time"
]
}

Go Live

  1. Click the Go Live button beside the configuration to be launched.