kafka: _MINIO_KAFKA_DEBUG to enable sarama debug messages (#19849)

This commit is contained in:
Anis Eleuch
2024-06-01 16:02:59 +01:00
committed by GitHub
parent e72429c79c
commit 2a75225569
2 changed files with 10 additions and 0 deletions

View File

@@ -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)