Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configuring log level #631

Open
crizo23 opened this issue Dec 18, 2020 · 4 comments
Open

configuring log level #631

crizo23 opened this issue Dec 18, 2020 · 4 comments

Comments

@crizo23
Copy link

crizo23 commented Dec 18, 2020

I think this was addressed in this commit
..but I'm not sure if it's working, if the README is wrong, or if I'm not configuring it correctly.
Currently, I see lots of INFO level output. I only want to see WARN level output, I've tried the following lines in my docker compose file:

      LOG4J_LOGGER_KAFKA_AUTHORIZER_LOGGER: WARN
      LOG4J_LOGGER_KAFKA_AUTHORIZER_LOGGER: FATAL, authorizerAppender

e.g.

my-kafka-broker-3:
    ....
    environment:
      ....
      KAFKA_BROKER_ID: 3
      LOG4J_LOGGER_KAFKA_AUTHORIZER_LOGGER: WARN, authorizerAppender

but neither seem to have an effect on what's logged.

The only thing I see in the logs pertaining to "logging" are:
[Configuring] 'log4j.logger.kafka.authorizer.logger' in '/opt/kafka/config/log4j.properties'

thanks for any help/clarifation

@rdlowrey
Copy link

I have the same problem ... not sure if it's E_PEBKAC 🤷

@kim-se-yeong
Copy link

Hi, I am using docker image of wurstmeister/kafka:2.13-2.6.0
I am also having the same problem. Have you ever solved this problem?

@giovanni-nabil
Copy link

giovanni-nabil commented Mar 27, 2022

Hi,
Using Kafka docker image wurstmeister/kafka:2.13-2.8.1 here.

This config actually does change the property inside opt/kafka/config/log4j.properties and is perfectly working for me,
for example, I'd use:

- LOG4J_LOGGER_KAFKA_REQUEST_LOGGER=TRACE, requestAppender

Notice that in my case I used requestAppender which outputs the logs to a file called kafka-request.log, If I wanted to see the logs in console output I'd change the property to LOG4J_LOGGER_KAFKA_REQUEST_LOGGER=TRACE, stdout instead or simply not specify an appender at all, it should default to stdout

In your case authorizerAppender also outputs the logs to a file called kafka-authorizer.log, so it won't have an effect on what's being logged to console output.
All the log files can be found under the configured logs directory.

What you want is to adjust the general broker logging levels

- LOG4J_LOGGER_KAFKA=WARN
- LOG4J_LOGGER_ORG_APACHE_KAFKA=WARN

@dvdblk
Copy link

dvdblk commented May 23, 2023

Hi, Using Kafka docker image wurstmeister/kafka:2.13-2.8.1 here.

This config actually does change the property inside opt/kafka/config/log4j.properties and is perfectly working for me, for example, I'd use:

- LOG4J_LOGGER_KAFKA_REQUEST_LOGGER=TRACE, requestAppender

Notice that in my case I used requestAppender which outputs the logs to a file called kafka-request.log, If I wanted to see the logs in console output I'd change the property to LOG4J_LOGGER_KAFKA_REQUEST_LOGGER=TRACE, stdout instead or simply not specify an appender at all, it should default to stdout

In your case authorizerAppender also outputs the logs to a file called kafka-authorizer.log, so it won't have an effect on what's being logged to console output. All the log files can be found under the configured logs directory.

What you want is to adjust the general broker logging levels

- LOG4J_LOGGER_KAFKA=WARN
- LOG4J_LOGGER_ORG_APACHE_KAFKA=WARN

Using wurstmeister/kafka:2.13-2.8.1 and added

- LOG4J_LOGGER_KAFKA=WARN
- LOG4J_LOGGER_ORG_APACHE_KAFKA=WARN

into a docker compose. Can still see every single log including INFO :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants