redirect log to file (optionally)