Write output to a file rather than the console