Log output to a text file on demand.