Skip to content

Inner class name be a logger name can not config level #714

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

Closed
raylua2566 opened this issue Jun 22, 2018 · 3 comments
Closed

Inner class name be a logger name can not config level #714

raylua2566 opened this issue Jun 22, 2018 · 3 comments

Comments

@raylua2566
Copy link

this.logger.debug("Received: " + records.count() + " records");

When I setting logging

org.springframework.kafka: debug

it will log repeat.

Received: 0 records

There is no way to disable that because the logger name is a inner class name org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer and config

org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer: info

is not work

@raylua2566 raylua2566 changed the title Logging Inner class name be a logger name can not config level Jun 22, 2018
@garyrussell
Copy link
Contributor

I presume you are setting those properties in application.yml; in which case it looks like a Boot problem. It works fine with a logback.xml file:

<configuration>

  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <!-- encoders are assigned the type
         ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
    <encoder>
      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    </encoder>
  </appender>

  <root level="info">
    <appender-ref ref="STDOUT" />
  </root>

  <logger name="org.springframework.kafka" level="debug" />
  <logger name="org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer" level="info" />

</configuration>

@garyrussell
Copy link
Contributor

This works...

logging.level.[org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer]=info

@garyrussell
Copy link
Contributor

Or like this with yaml:

logging:
  level:
    org.springframework.kafka: debug
    org.springframework.kafka.listener.[KafkaMessageListenerContainer$ListenerConsumer]: 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

2 participants