kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gwens...@apache.org
Subject kafka git commit: KAFKA-2407: Only create log directory when it will be used
Date Wed, 05 Aug 2015 18:46:18 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 9cefb2a0f -> fc40016cf


KAFKA-2407: Only create log directory when it will be used

Author: Grant Henke <granthenke@gmail.com>

Reviewers: Gwen Shapira

Closes #115 from granthenke/log-fix and squashes the following commits:

de36138 [Grant Henke] Small comment fix
49a8dd4 [Grant Henke] KAFKA-2407: Only create log directory when it will be used


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/fc40016c
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/fc40016c
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/fc40016c

Branch: refs/heads/trunk
Commit: fc40016cf3cc4143f2e8486722737da3461771e6
Parents: 9cefb2a
Author: Grant Henke <granthenke@gmail.com>
Authored: Wed Aug 5 11:46:11 2015 -0700
Committer: Gwen Shapira <cshapi@gmail.com>
Committed: Wed Aug 5 11:46:11 2015 -0700

----------------------------------------------------------------------
 bin/kafka-run-class.sh | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/fc40016c/bin/kafka-run-class.sh
----------------------------------------------------------------------
diff --git a/bin/kafka-run-class.sh b/bin/kafka-run-class.sh
index ebe7409..2f00f68 100755
--- a/bin/kafka-run-class.sh
+++ b/bin/kafka-run-class.sh
@@ -22,15 +22,6 @@ fi
 
 base_dir=$(dirname $0)/..
 
-# create logs directory
-if [ "x$LOG_DIR" = "x" ]; then
-    LOG_DIR="$base_dir/logs"
-fi
-
-if [ ! -d "$LOG_DIR" ]; then
-    mkdir -p "$LOG_DIR"
-fi
-
 if [ -z "$SCALA_VERSION" ]; then
 	SCALA_VERSION=2.10.5
 fi
@@ -96,9 +87,20 @@ if [  $JMX_PORT ]; then
   KAFKA_JMX_OPTS="$KAFKA_JMX_OPTS -Dcom.sun.management.jmxremote.port=$JMX_PORT "
 fi
 
+# Log directory to use
+if [ "x$LOG_DIR" = "x" ]; then
+    LOG_DIR="$base_dir/logs"
+fi
+
 # Log4j settings
 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
+  # create logs directory
+  if [ ! -d "$LOG_DIR" ]; then
+    mkdir -p "$LOG_DIR"
+  fi
 fi
 
 KAFKA_LOG4J_OPTS="-Dkafka.logs.dir=$LOG_DIR $KAFKA_LOG4J_OPTS"


Mime
View raw message