I have used Debug.WriteLine to debug an existing legacy application to find the program flow. Now I'm studying an event (message) based application which contains multiple services which react on events. It uses many cloud (like Azure) resources.
I'm trying to understand the different logging system ETW (Event Tracing For Windows), TraceLogging and log4Net etc... Which one among these supports logging of system exceptions (especially exceptions coming from cloud services or resources), program exceptions, coded logging etc...
With ETW you can also capture Kernel data and see how your code effects CPU, Disk usage. You can also capture callstacks for ETW events (call stack for kernel mode events in Vista and also usermode events since Windows 7).
The .Net Runtime ETW Provider raises Exceptions when you activate logging with ExceptionKeyword
keyword. I've already posted a Profile which activates call stacks for Exceptions, Assembly (Un)Load Events here on Stack Overflow. Here you can see the callstack for Exceptions.
The advantage of ETW is its great performance compared to other logging methods. Also logging is disabled until you explicitly activate the listening to events and the captured ETL file can be transfered to other devices and analyzed there.