How Add a Kafka appender in prlog4j2.xml for PEGA 8.4.3
Hi,
I'm trying to add a Kafka appender in prlog4j2.xml but it results in a Java exception:
2021-05-06 07:49:08,434 main ERROR There was a problem initializing the LoggerContext using configuration file:XXXXXXXXXXXX/prlog4j2.xml org.apache.kafka.common.config.ConfigException: Invalid value org.apache.kafka.common.serialization.ByteArraySerializer for configuration key.serializer: Class org.apache.kafka.common.serialization.ByteArraySerializer could not be found. at org.apache.kafka.common.config.ConfigDef.parseType(ConfigDef.java:724) at org.apache.kafka.common.config.ConfigDef.parseValue(ConfigDef.java:469) at org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:462)
What I did so far:
- Import kafka-log4j-appender-1.1.1.jar via Application->Distribution->Import (I kept all default values during Import)
- Modify prlog4j2.xml to add this extra kafka appender
- Restart server
I checked in pr_engineclasses table and both kafka-log4j-appender-1.1.1 and kafka-client-1.1.1 are available.
Modification in prlog4j2.xml are as follow:
Hi,
I'm trying to add a Kafka appender in prlog4j2.xml but it results in a Java exception:
2021-05-06 07:49:08,434 main ERROR There was a problem initializing the LoggerContext using configuration file:XXXXXXXXXXXX/prlog4j2.xml org.apache.kafka.common.config.ConfigException: Invalid value org.apache.kafka.common.serialization.ByteArraySerializer for configuration key.serializer: Class org.apache.kafka.common.serialization.ByteArraySerializer could not be found. at org.apache.kafka.common.config.ConfigDef.parseType(ConfigDef.java:724) at org.apache.kafka.common.config.ConfigDef.parseValue(ConfigDef.java:469) at org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:462)
What I did so far:
- Import kafka-log4j-appender-1.1.1.jar via Application->Distribution->Import (I kept all default values during Import)
- Modify prlog4j2.xml to add this extra kafka appender
- Restart server
I checked in pr_engineclasses table and both kafka-log4j-appender-1.1.1 and kafka-client-1.1.1 are available.
Modification in prlog4j2.xml are as follow:
- In Appenders part:
<Kafka name="KafkaAppender" topic="C1.log-MYTOPIC.001"> <Property name="bootstrap.servers">server1:yyyyy,server2.france.airfrance.fr:yyyy,server3.france.airfrance.fr:yyyy,server4.france.airfrance.fr:yyyy</Property> </Kafka>
- In Loggers/asyncRoot part:
<AppenderRef ref="KafkaAppender" level="INFO"/>
Could anyone help me in finding why I can not use this Kafka appender ?
Thanks !