You can direct the output of a trace to a file using the -file filename option. For example, the following command directs trace output to the file trace1:
(dbx) trace -file trace1
To revert trace output to standard output use - for filename. Trace output is always appended to filename. It is flushed whenever dbx prompts and when the application has exited. The file is always reopened on a new run or resumption after an attach.