0

I found that Kafka by default prints everything as stderr I want to change that and i found i have to add an log4j.properties file

I have created one and added properties that atleast should change it for an consumer but everything is still written to stderr

I have the same properties file also in main/ressources just to be sure

Picture of my log4j.properties file

My pom.xml

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245

1 Answers1

0

log4j.properties is for log4j 1.x, which is what Kafka uses

However, you've defined log4j 2.x as your dependency, which is going to look for a log4j2.properties file in src/main/resources

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • So what do i have to change the loggin? rename the properties file or change my dependencie in the pom.xml? – CorneliusLiepelt Aug 13 '21 at 13:22
  • I'd start with changing your dependencies to remove the `org.apache.logging` ones and try using logback (with a logback.xml file instead). For example https://github.com/OneCricketeer/kafka-streams-jib-example/blob/master/src/main/resources/logback.xml – OneCricketeer Aug 13 '21 at 14:03