frankvicky commented on code in PR #17373:
URL: https://github.com/apache/kafka/pull/17373#discussion_r1843393551


##########
bin/connect-distributed.sh:
##########
@@ -22,8 +22,15 @@ fi
 
 base_dir=$(dirname $0)
 
-if [ "x$KAFKA_LOG4J_OPTS" = "x" ]; then
+if [ -f "$base_dir/../config/connect-log4j.properties" ]; then
+    echo DEPRECATED: Using Log4j 1.x configuration file 
\$KAFKA_HOME/config/connect-log4j.properties >&2
+    echo To use a Log4j 2.x configuration, create a 
\$KAFKA_HOME/config/log4j2.xml file and remove the Log4j 1.x configration. >&2
+    echo See 
https://logging.apache.org/log4j/2.x/migrate-from-log4j1.html#Log4j2ConfigurationFormat
 for details about Log4j configuration file migration. >&2
     export 
KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/connect-log4j.properties"
+elif [ -f "$base_dir/../config/connect-log4j2.properties" ]; then
+    export 
KAFKA_LOG4J_OPTS="-Dlog4j2.configurationFile=$base_dir/../config/connect-log4j2.properties"
+elif [ -f "$base_dir/../config/connect-log4j2.xml" ]; then
+    export 
KAFKA_LOG4J_OPTS="-Dlog4j2.configurationFile=$base_dir/../config/connect-log4j2.xml"

Review Comment:
   Make sense. 
   Yes, we can change the order of the if-case to achieve that. I will update 
it in a follow-up PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to