[ 
https://issues.apache.org/jira/browse/KAFKA-1204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13870290#comment-13870290
 ] 

Joe Stein commented on KAFKA-1204:
----------------------------------

Hi J, that is not a bad idea and can see it being helpful for folks to not have 
to change the script to use it differently, sure.  can you modify it though to 
work like the JMX_PORT does so folks can have a consistent use of the scripts.  
So, if KAFKA_LOG_DIR
 is not specified in the environment variable then it would default to use what 
exists now without any changes but then they could specify KAFKA_LOG_DIR as an 
env variable.  Also take a look at the git work flow 
https://cwiki.apache.org/confluence/display/KAFKA/Git+Workflow and patch review 
tool for 
https://cwiki.apache.org/confluence/display/KAFKA/Kafka+patch+review+tool for 
updates/changes to the project, thanks!

> 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.1.5#6160)

Reply via email to