added logging function for tailing logs