Added Log to file function