Prevent kafka from logging to /var/log/messages

Hi folks,
The other day i was looking in to issues with disks filling up on brokers.
I noticed that particularlly /var/log/messages were huge.
When looking at the content of messages there were lots of logs that were identical to the logs i have in /var/log/kafka/server.log.
With the amount of logs kafka can produce this will be a recuring issues for me.
I am guessing it is a setting in log4j.properties i need to change, but i have not yet been able to find an authorative answer yet, hence i am reaching out to the community :slight_smile:

Best regards

Oelsner

Hi @Oelsner

short question:
how did you install Kafka?
did you use the package based installation or the zip/tar based?

Best,
Michael

Hi @mmuehlbeyer
It is installed using package based installation.

Regards
Oelsner

thanks
I assume OS is redhat?
which confluent edition? community or enterprise?

regards,
michael

Hi @mmuehlbeyer
Yes, redhat 7.9
Confluent edition is enterprise 6.2.2

Best regards
Oelsner

Hi @Oelsner

need to check keep you posted.

Best,
michael

Hi @Oelsner

tested a little , for me a proper way to disable logging to /var/log/messages
seems to be changing the following in log4j.properties

log4j.rootLogger=INFO, stdout, kafkaAppender

to

log4j.rootLogger=INFO, kafkaAppender

Best,
michael

1 Like

hi @mmuehlbeyer

Thanks so much, it is really appreciated :slight_smile:
I shall try it out first thing in the morning!
Will report back here with result.

Best regards
Oelsner