cp-docker-images
cp-docker-images copied to clipboard
Log4j version
Actually, log4j version 1.2.17 seems to be used in almost every docker images, and it causes us this problem :
We gather every log lines produced by the business softwares with Logstash to access them from Kibana. For Logstash to process outputs efficiently every log output must me on the same line, else it consider it as many lines. It's particularily important when the said output contains a stacktrace. We need to configure logger layout to escape linefeeds (\n), and we do it with the Pattern Layout.
Log4j 1 has a layout class named org.apache.log4j.EnhancedPatternLayout to do that but it doesn't support the %replace keyword. We didn't find any other alternative with the version of log4j. The obvious solution for us would be to replace the log4j jar by overriding the docker image but it's a smelly backdoor patch that we'd prefer to avoid.
Do you plan to upgrade log4j in your docker images? And if not do you have any suggestion to help us with this issue?
Kafka uses the slf4j-log4j bridge. You should in theory be able to plugin in any SLF4j provider by replacing the JAR and using the appropriate JVM property to load a different logging configuration file.