CONFLUENT PLATFORM
To change the default logging levels or add new logging levels:
{COMPONENT}_LOG4J_ROOT_LOGLEVEL
rootLogger
{COMPONENT}_LOG4J_LOGGERS
KAFKA_LOG4J_LOGGERS="kafka.controller=WARN,kafka.foo.bar=DEBUG"
{COMPONENT}_LOG4J_TOOLS_ROOT_LOGLEVEL
Replace {COMPONENT} as below for the component you are changing the log level for:
{COMPONENT}
ZOOKEEPER
KAFKA
CONTROL_CENTER
SCHEMA_REGISTRY
KAFKA_REST
CONNECT
KSQL
An example command to change the log level for Kafka is:
docker run -d \ --name=kafka-log-example \ --net=host \ -e KAFKA_BROKER_ID=1 \ -e KAFKA_ZOOKEEPER_CONNECT=localhost:32181/jmx \ -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:39092 \ -e KAFKA_JMX_PORT=39999 \ -e KAFKA_LOG4J_LOGGERS="kafka.controller=WARN,kafka.foo.bar=DEBUG" \ -e KAFKA_LOG4J_ROOT_LOGLEVEL=WARN \ -e KAFKA_TOOLS_LOG4J_LOGLEVEL=ERROR \ -e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 \ confluentinc/cp-kafka:6.1.0
All logs are sent to stdout by default. You can change this by extending the images.
stdout