Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Not A Problem
-
3.6.0
-
None
-
None
Description
When I try to configure the batchSize of the Kafka log4j2 appender the application logs the following error:
ERROR StatusConsoleListener Kafka contains an invalid element or attribute "batchSize"
This is an example of configuration that fails:
<?xml version="1.0" encoding="UTF-8"?> <Configuration status="WARN"> <Appenders> <Console name="LogToConsole" target="SYSTEM_OUT"> <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" /> </Console> <Kafka name="Kafka" topic="log-collector" syncSend="false" batchSize="8192"> <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" /> <Property name="bootstrap.servers">localhost:9092</Property> </Kafka> </Appenders> <Loggers> <Root level="info"> <AppenderRef ref="LogToConsole" /> <AppenderRef ref="Kafka" /> </Root> <Logger name="org.apache.kafka" level="WARN" /><!-- avoid recursive logging --> </Loggers> </Configuration>
Please note that other parameters like syncSend work fine.
Could be possible that log4j2 expects this field:
as a String for working fine?