[ https://issues.apache.org/jira/browse/KAFKA-1368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17067811#comment-17067811 ]
Tom Bentley commented on KAFKA-1368: ------------------------------------ I've looked at this and there are two basic problems which need to be addressed: 1. `Log4jController` has a hard dependency on log4j. This could be made to work with log4j2 keeping it current API (essentially becoming a façade). 2. On its own 1. is not a drop-in replacement. Users would have to delete the log4j and slf4j-log4j12 jars from the lib directory and add the log4j2 ones and also write their own {{log4j2.properties}}, {{tools-log4j2.properties}} and {{connect-log4j2.properties}} files. Including the log4j2 jars with the distribution would be a bit tricky because of slf4j's static binding approach. We'd need to ensure only one binding was on the classpath. Then we'd need a mechanism for the user to select log4j2, perhaps a {{--logging=log4j2}} option for `kafka-server-start.sh` and `zookeeper-server-start.sh` etc, or maybe inspecting {{KAFKA_LOG4J_OPTS}} to see if the config file was {{log4j.properties}} or {{log4j2.properties}}. I'm assuming we would stick with log4j by default until Kafka 3.0, anything else would risk regressions. Any thoughts on this [~ijuma], [~ewencp], [~mimaison]? Would this need a KIP? > Upgrade log4j > ------------- > > Key: KAFKA-1368 > URL: https://issues.apache.org/jira/browse/KAFKA-1368 > Project: Kafka > Issue Type: Improvement > Affects Versions: 0.8.0 > Reporter: Vladislav Pernin > Assignee: Tom Bentley > Priority: Major > > Upgrade log4j to at least 1.2.16 ou 1.2.17. > Usage of EnhancedPatternLayout will be possible. > It allows to set delimiters around the full log, stacktrace included, making > log messages collection easier with tools like Logstash. > Example : <[%d{XXXX}]...[%t] %m%throwable>%n > <[2014-04-08 11:07:20,360] ERROR [KafkaApi-1] Error when processing fetch > request for partition [XXXXX,6] offset 700 from consumer with correlation id > 0 (kafka.server.KafkaApis) > kafka.common.OffsetOutOfRangeException: Request for offset 700 but we only > have log segments in the range 16021 to 16021. > at kafka.log.Log.read(Log.scala:429) > ... > at java.lang.Thread.run(Thread.java:744)> -- This message was sent by Atlassian Jira (v8.3.4#803005)