Redirect log to file with option