Browse Source
kafka: _MINIO_KAFKA_DEBUG to enable sarama debug messages (#19849)
pull/19862/head
Anis Eleuch
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
10 additions and
0 deletions
-
internal/event/target/kafka.go
-
internal/logger/target/kafka/kafka.go
|
|
@ -24,6 +24,7 @@ import ( |
|
|
|
"encoding/json" |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"log" |
|
|
|
"net/url" |
|
|
|
"os" |
|
|
|
"path/filepath" |
|
|
@ -331,6 +332,10 @@ func (target *KafkaTarget) init() error { |
|
|
|
} |
|
|
|
|
|
|
|
func (target *KafkaTarget) initKafka() error { |
|
|
|
if os.Getenv("_MINIO_KAFKA_DEBUG") != "" { |
|
|
|
sarama.DebugLogger = log.Default() |
|
|
|
} |
|
|
|
|
|
|
|
args := target.args |
|
|
|
|
|
|
|
config := sarama.NewConfig() |
|
|
|
|
|
@ -24,6 +24,7 @@ import ( |
|
|
|
"encoding/json" |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"log" |
|
|
|
"os" |
|
|
|
"path/filepath" |
|
|
|
"sync" |
|
|
@ -234,6 +235,10 @@ func (h *Target) send(entry interface{}) error { |
|
|
|
|
|
|
|
// Init initialize kafka target
|
|
|
|
func (h *Target) init() error { |
|
|
|
if os.Getenv("_MINIO_KAFKA_DEBUG") != "" { |
|
|
|
sarama.DebugLogger = log.Default() |
|
|
|
} |
|
|
|
|
|
|
|
sconfig := sarama.NewConfig() |
|
|
|
if h.kconfig.Version != "" { |
|
|
|
kafkaVersion, err := sarama.ParseKafkaVersion(h.kconfig.Version) |
|
|
|