I agree that creating some log routines to handle writing to a log file (or using the Application Event Log -- or custom event log (not sure how they work yet)) would be better than trying to redirect std-out, or using OutputDebugString.
You may want a more flexible log function similar to sprintf that takes a variable number of arguments. If you analyze sprintf or .Format, one of them will show you how that works, and you can simply replace the printf and puts with your own logging function that takes a format string and variable number of arguments and writes to your own text file / event log. You will probably have to serialize the output to the file with a critical section / lock. Thus you will want to have logging as optional configuration.
Ensure that account running the web service (local system / local service / specific service account / or riding on user credential) has access to write / create the log file in the directory you are writing to.
The Clinkmeister