added writeToFile in Log class