[ https://issues.apache.org/jira/browse/KAFKA-2728?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Noll updated KAFKA-2728: -------------------------------- Description: I noticed that the {{bin/kafka-run-class.sh}} and the {{bin/windows/kafka-run-class.bat}} scripts 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 (one of the two buggy scripts) {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} Set up {{KAFKA_LOG4J_OPTS}} as in {{kafka-run-class.bat}} follows (careful, I am not that familiar with Windows .bat scripting): {code} set KAFKA_LOG4J_OPTS=-Dlog4j.configuration=file:%BASE_DIR%/../config/tools-log4j.properties {code} was: I noticed that the {{bin/kafka-run-class.sh}} and the {{bin/windows/kafka-run-class.bat} scripts 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 (one of the two buggy scripts) {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} Set up {{KAFKA_LOG4J_OPTS}} as in {{kafka-run-class.bat}} follows (careful, I am not that familiar with Windows .bat scripting): {code} set KAFKA_LOG4J_OPTS=-Dlog4j.configuration=file:%BASE_DIR%/../config/tools-log4j.properties {code} > 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}} and the > {{bin/windows/kafka-run-class.bat}} scripts 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 (one of the two buggy scripts) > {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} > Set up {{KAFKA_LOG4J_OPTS}} as in {{kafka-run-class.bat}} follows (careful, I > am not that familiar with Windows .bat scripting): > {code} > set > KAFKA_LOG4J_OPTS=-Dlog4j.configuration=file:%BASE_DIR%/../config/tools-log4j.properties > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)