confluentinc / schema-registry-images

Docker Images for Schema Registry
Apache License 2.0
2 stars 21 forks source link

Prevent duplicate logs from log4j template #38

Closed dylanmei closed 2 months ago

dylanmei commented 3 years ago

When specifying SCHEMA_REGISTRY_LOG4J_LOGGERS the materialized log4j template causes duplicated logs for each logger specified.

For example, these settings make the system less chatty:

environment:
  SCHEMA_REGISTRY_LOG4J_ROOT_LOGLEVEL: "ERROR"
  SCHEMA_REGISTRY_LOG4J_LOGGERS: "io.confluent.rest-utils.requests=INFO,io.confluent.rest.exceptions.DebuggableExceptionMapper=FATAL"

But the template renders the appender after the level and triggers log4j's additivity, causing duplicate logs.

log4j.rootLogger=ERROR, stdout

log4j.logger.io.confluent.rest-utils.requests=INFO, stdout
log4j.logger.io.confluent.rest.exceptions.DebuggableExceptionMapper=FATAL, stdout

Other Confluent-based container images don't do this: