Get all text from System.out

Salutations,

I am creating a logging system for MERCury, and I want to be able to save all of the console output into a file. Is there a way to take all of what was put into System.out, and print it to a file?

Thanks,
-wes