Wrong log4j properties file picked up by Kafka start script

2,217 views
Skip to first unread message

Sigurd Knippenberg

unread,
Mar 20, 2015, 3:37:04 PM3/20/15
to confluent...@googlegroups.com
When I run the following command: 

/usr/bin/kafka-server-start /etc/kafka/server.properties

It picks up the /etc/kafka/tools-log4j.properties file and not the /etc/kafka/log4j.properties file.

I think that is because the following KAFKA_LOG4J_OPTS variable is set in the /usr/bin/kafka-server-start script without the export statement:

if [ "x$KAFKA_LOG4J_OPTS" = "x" ]; then

  if [ -e "/etc/kafka/log4j.properties" ]; then # Normal install layout

    KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:/etc/kafka/log4j.properties"

  elif [ -e "$base_dir/../etc/kafka/log4j.properties" ]; then # Simple zip file layout

    KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../etc/kafka/log4j.properties"

  else # Fallback to normal default

    KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/config/log4j.properties"

  fi

fi


It works fine like this:

if [ "x$KAFKA_LOG4J_OPTS" = "x" ]; then

  if [ -e "/etc/kafka/log4j.properties" ]; then # Normal install layout

    export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:/etc/kafka/log4j.properties"

  elif [ -e "$base_dir/../etc/kafka/log4j.properties" ]; then # Simple zip file layout

    export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../etc/kafka/log4j.properties"

  else # Fallback to normal default

    export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/config/log4j.properties"

  fi

fi

I assume this script is coming from Confluent since the script in Kafka's GitHub (https://github.com/apache/kafka/blob/0.8.2/bin/kafka-server-start.sh) is different (and it does contain the export statement).

Sigurd

Jun Rao

unread,
Mar 25, 2015, 2:10:55 PM3/25/15
to confluent...@googlegroups.com
Thanks for reporting this. Yes, that seems like a bug. We will fix it in the next release.

Jun

--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/53ab165f-089e-4bf5-8a20-a57833f6b889%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

eel...@gmail.com

unread,
Mar 27, 2015, 3:34:08 PM3/27/15
to confluent...@googlegroups.com
FYI, this bug is also is present in zookeeper-server-start.

-John
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.

Uday Kadam

unread,
Dec 9, 2016, 3:38:56 PM12/9/16
to Confluent Platform
IS the BUG Fixed?lots of bugs
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages