Michael Noll created KAFKA-2728:
-----------------------------------
Summary: kafka-run-class.sh: incorrect path to
tools-log4j.properties for KAFKA_LOG4J_OPTS
Key: KAFKA-2728
URL: https://issues.apache.org/jira/browse/KAFKA-2728
Project: Kafka
Issue Type: Bug
Components: config, core
Affects Versions: 0.9.0.0
Reporter: Michael Noll
I noticed that the {{bin/kafka-run-class.sh}} script in current trunk (as of
commit e466ccd) seems to set up the KAFKA_LOG4J_OPTS environment variable
incorrectly. Noticeably, the way to construct the path to
{{config/tools-log4j.properties}} is wrong, and it is inconsistent to how the
other bin scripts configure the paths to their {{config/*.properties}} files.
Example: bin/kafka-run-class.sh (the buggy script)
{code}
if [ -z "$KAFKA_LOG4J_OPTS" ]; then
# Log to console. This is a tool.
KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/config/tools-log4j.properties"
else
...snip...
{code}
Example: bin/kafka-server-start.sh (a correct script)
{code}
if [ "x$KAFKA_LOG4J_OPTS" = "x" ]; then
export
KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/log4j.properties"
fi
{code}
In the examples above, note the difference between:
{code}
# Without ".."
file:$base_dir/config/tools-log4j.properties
# With ".."
file:$base_dir/../config/log4j.properties
{code}
*How to fix*
Set up {{KAFKA_LOG4J_OPTS}} as in {{kafka-run-class.sh}} follows:
{code}
KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/tools-log4j.properties"
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)