Just to take a different approach, you could also do this on the command line without any changes to your code. Take that with a pinch of salt though as you didn't give us any code to go on.
If you want all output from your program to go into a file:
./yourprog > combined_file.txt 2>&1If you want regular data in one file, error data in another:
./yourprog 1> regular_data.txt 2> error_data.txtIn reply to Re: Creating log files for errors and warnings
by vek
in thread Creating log files for errors and warnings
by tej
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |