confluentinc / schema-registry

Confluent Schema Registry for Kafka
https://docs.confluent.io/current/schema-registry/docs/index.html
Other
2.2k stars 1.11k forks source link

kafka-avro-console-consumer logs to stdout #2802

Open dlipofsky opened 11 months ago

dlipofsky commented 11 months ago

Starting with confluent-community-7.4.0.zip
the kafka-avro-console-consumer
logs a bunch of stuff to stdout at startup.
Before 7.4.0 it would only ever log the actual messages to stdout.
I have a lot of test scripts that depend on just messages to stdout.

I am able to suppress it with

sed -i -e 's/rootLogger=INFO/rootLogger=WARN/' etc/schema-registry/log4j.properties

although I did confirm the log4j.properties itself has not changed between versions, so it must be a code change.

I'm running with OpenJDK 17.0.8 on Rocky Linux 9.2 and the output looks like

$ bin/kafka-avro-console-consumer --topic price-events --bootstrap-server $BOOTSTRAP --property schema.registry.url="$SCHEMAREG" | head -90
[2023-10-20 21:08:06,837] INFO KafkaAvroDeserializerConfig values: 
    auto.register.schemas = true
    avro.reflection.allow.null = false
    avro.use.logical.type.converters = false
    basic.auth.credentials.source = URL
    basic.auth.user.info = [hidden]
    bearer.auth.cache.expiry.buffer.seconds = 300
    bearer.auth.client.id = null
    bearer.auth.client.secret = null
    bearer.auth.credentials.source = STATIC_TOKEN
    bearer.auth.custom.provider.class = null
    bearer.auth.identity.pool.id = null
    bearer.auth.issuer.endpoint.url = null
    bearer.auth.logical.cluster = null
    bearer.auth.scope = null
    bearer.auth.scope.claim.name = scope
    bearer.auth.sub.claim.name = sub
    bearer.auth.token = [hidden]
    context.name.strategy = class io.confluent.kafka.serializers.context.NullContextNameStrategy
    http.connect.timeout.ms = 60000
    http.read.timeout.ms = 60000
    id.compatibility.strict = true
    key.subject.name.strategy = class io.confluent.kafka.serializers.subject.TopicNameStrategy
    latest.cache.size = 1000
    latest.cache.ttl.sec = -1
    latest.compatibility.strict = true
    max.schemas.per.subject = 1000
    normalize.schemas = false
    proxy.host = 
    proxy.port = -1
    rule.actions = []
    rule.executors = []
    rule.service.loader.enable = true
    schema.format = null
    schema.reflection = false
    schema.registry.basic.auth.user.info = [hidden]
    schema.registry.ssl.cipher.suites = null
    schema.registry.ssl.enabled.protocols = [TLSv1.2, TLSv1.3]
    schema.registry.ssl.endpoint.identification.algorithm = https
    schema.registry.ssl.engine.factory.class = null
    schema.registry.ssl.key.password = null
    schema.registry.ssl.keymanager.algorithm = SunX509
    schema.registry.ssl.keystore.certificate.chain = null
    schema.registry.ssl.keystore.key = null
    schema.registry.ssl.keystore.location = null
    schema.registry.ssl.keystore.password = null
    schema.registry.ssl.keystore.type = JKS
    schema.registry.ssl.protocol = TLSv1.3
    schema.registry.ssl.provider = null
    schema.registry.ssl.secure.random.implementation = null
    schema.registry.ssl.trustmanager.algorithm = PKIX
    schema.registry.ssl.truststore.certificates = null
    schema.registry.ssl.truststore.location = null
    schema.registry.ssl.truststore.password = null
    schema.registry.ssl.truststore.type = JKS
    schema.registry.url = [http://schema-registry.x.com:8085]
    specific.avro.key.type = null
    specific.avro.reader = false
    specific.avro.value.type = null
    use.latest.version = false
    use.latest.with.metadata = null
    use.schema.id = -1
    value.subject.name.strategy = class io.confluent.kafka.serializers.subject.TopicNameStrategy
 (io.confluent.kafka.serializers.KafkaAvroDeserializerConfig:376)
dlipofsky commented 11 months ago

I'm would guess the actual intent is to have this go to logs/schema-registry.log, not stdout. Changing the rootLogger to WARN as I first suggested prevents that, but you can instead add

log4j.logger.io.confluent=INFO,file
log4j.additivity.io.confluent=false

to etc/schema-registry/log4j.properties, and perhaps there are better ways to do this.

dlipofsky commented 7 months ago

Has anyone from the confluent team looked at this?