kafka-docker icon indicating copy to clipboard operation
kafka-docker copied to clipboard

Add a case sensitive option for adding entries to log4j.properties

Open jcaesar opened this issue 4 years ago • 3 comments

#188 / 5d324f14ccd7030355e618e81a31ef0d45dcba35 added reading the LOG4J_ environment variables, but converts all keys to lowercase. Please correct me if I'm wrong on this: Matches in log4j.properties are case sensitive, this LOG4J_ only allowed configuring logging per package (since java package names are lower case), but not for single classes (which are in CamelCase).

I've decided to keep LOG4J_ for backwards compatibility. Also not that I think this PR is of minor importance, since the functionality of both log4j_ and LOG4J_ can be easily replaced by

    entrypoint: |
      bash -c "
        echo >>/opt/kafka/config/log4j.properties log4j.logger.kafka.server.KafkaConfig=WARN
        exec start-kafka.sh
      "

and similar tricks.

jcaesar avatar Jul 03 '20 07:07 jcaesar

@gwilym as you are the author of the original PR, I'd be happy if I could get a comment from you.

jcaesar avatar Jul 03 '20 07:07 jcaesar

Appreciate the mention @jcaesar however unfortunately I'm not sure I can be of much assistance as I'm not that familiar with how uses of log4j can vary. I only have surface awareness of log4j from an operational standpoint (e.g. reading documentation to run a containerised Kafka and similar services) and I wasn't aware that class-specific configurations like this were a feature.

So I'd have to defer to the Java / log4j experts 🙇

gwilym avatar Jul 07 '20 01:07 gwilym

Hey @wurstmeister, is there anything that would push this PR further?

We've faced the limitations mentioned in #325, and this PR definitely fixes #325

Felixoid avatar Jul 08 '21 12:07 Felixoid