Added kafka scripts and fixed infinte logging loop