Succesfully reading data and writing directly to log file