File rotate-gc-log.patch of Package kafka
Index: bin/kafka-run-class.sh
===================================================================
--- bin/kafka-run-class.sh.orig
+++ bin/kafka-run-class.sh
@@ -268,6 +268,8 @@ GC_LOG_FILE_NAME=''
if [ "x$GC_LOG_ENABLED" = "xtrue" ]; then
GC_LOG_FILE_NAME=$DAEMON_NAME$GC_FILE_SUFFIX
KAFKA_GC_LOG_OPTS="-Xloggc:$LOG_DIR/$GC_LOG_FILE_NAME -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps "
+ # and log rotation
+ KAFKA_GC_LOG_OPTS="$KAFKA_GC_LOG_OPTS -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=10M "
fi
# If Cygwin is detected, classpath is converted to Windows format.