[
https://issues.apache.org/jira/browse/KAFKA-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14049119#comment-14049119
]
J Potter commented on KAFKA-1204:
---------------------------------
Hi Guozhang,
It looks like trunk has a slightly different (and perfectly fine) fix for this
issue, so this ticket can be marked as resolved by whatever version trunk
currently reflects.
Thanks!
-Jeff
> Add KAFKA_LOG_DIR to allow LOG_DIR to be outside of code dir
> ------------------------------------------------------------
>
> Key: KAFKA-1204
> URL: https://issues.apache.org/jira/browse/KAFKA-1204
> Project: Kafka
> Issue Type: Improvement
> Components: core
> Reporter: J Potter
> Labels: patch
> Original Estimate: 10m
> Remaining Estimate: 10m
>
> The kafka-run-class.sh script currently generates a LOG_DIR variable and
> expects the path under base_dir/logs to be writeable by the process, without
> a way of overriding it.
> I think a simple change as below would allow ops folks to fire it up and
> point the LOG_DIR elsewhere, as desired.
> bin/kafka-run-class.sh
> @@ -23,9 +23,11 @@ fi
> base_dir=$(dirname $0)/..
>
> # create logs directory
> -LOG_DIR=$base_dir/logs
> -if [ ! -d $LOG_DIR ]; then
> - mkdir $LOG_DIR
> +if [ -z "KAFKA_LOG_DIR" ]; then
> + KAFKA_LOG_DIR=$base_dir/logs
> +fi
> +if [ ! -d $KAFKA_LOG_DIR ]; then
> + mkdir $KAFKA_LOG_DIR
> fi
>
> if [ -z "$SCALA_VERSION" ]; then
> @@ -98,7 +100,7 @@ if [ "$1" = "daemon" ] && [ -z "$KAFKA_GC_LOG_OPTS"] ; then
> shift
> GC_LOG_FILE_NAME=$1$GC_FILE_SUFFIX
> shift
> - KAFKA_GC_LOG_OPTS="-Xloggc:$LOG_DIR/$GC_LOG_FILE_NAME -verbose:gc
> -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps "
> + KAFKA_GC_LOG_OPTS="-Xloggc:$KAFKA_LOG_DIR/$GC_LOG_FILE_NAME -verbose:gc
> -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps "
> fi
>
> exec $JAVA $KAFKA_HEAP_OPTS $KAFKA_JVM_PERFORMANCE_OPTS $KAFKA_GC_LOG_OPTS
> $KAFKA_JMX_OPTS $KAFKA_LOG4J_OPTS -cp $CLASSPATH $KAFKA_OPTS "$@"
--
This message was sent by Atlassian JIRA
(v6.2#6252)