confluent-schema-registry

How to configure the logger of schema registry image with helm chart deployment


I use schema registry 5.4 - https://hub.docker.com/r/confluentinc/cp-schema-registry/, and use helm chart https://github.com/helm/charts/tree/master/incubator/schema-registry to deploy.

To set my logger, I create a configmap and mount it to the schema registry container that uses the image -confluentinc/cp-schema-registry:5.4.0

apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "schema-registry.fullname" . }}-log4j-configmap
  labels:
    app: {{ template "schema-registry.name" . }}
    chart: {{ template "schema-registry.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
data:
  log4j.properties: |+
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.encoding=UTF-8

But I don't know what should be changed in the command of the container, or there is a variable pointing to log4j.properties to set it? for example I plan to change the command like the following:

command:
- java
- -Dlog4j.configuration=file:/etc/schema-registry-log4j/log4j.properties
- -jar
- schema-registry.jar

Solution

  • Option 1:

    One way I found is to build a new image using FROM and put my custom log4j properties there.

    https://docs.confluent.io/current/installation/docker/development.html#log-to-external-volumes

    Option 2: The other way is to set an environment variable

    SCHEMA_REGISTRY_LOG4J_LOGGERS="org.apache.kafka=ERROR,io.confluent.rest.exceptions=FATAL"