Question 331. Can I Redirect Tracing To A File?
On Windows using SWI-Prolog you can use protocol/1 protocol/1 will copy the output that goes to the screen to a file. So if you run a trace/0 and the output goes to the screen, a copy will be sent to a file. To simplify having to write the entire path for protocol/1 I find it easier to set the current working directory using working_directory/2 and then only set the specific file with protocol/1