Make sure path to log exists before writing to it (maybe this should go directly in file)