Added log rotate functionality