What is the difference between Tracing and Logging?

pencilCake picture pencilCake · Dec 2, 2014 · Viewed 17.8k times · Source

From the terminology point of view and in general, what is the difference between a 'tracing' and a 'logging' ?

Thanks!

Answer

Stopfan picture Stopfan · Dec 2, 2014

Logging is not Tracing!

Logging:

When you design a big application, you need to have good and flexible error reporting - perhaps across machines - to collect log data in a centralized way. That is a perfect use case for the Logging Application Block where you configure some remote trace listener, and send the log data to a central log server which stores its log messages in a database, log file or whatever. If you use out-of-process communication, you are limited by the network performance already, which in the best case is several thousand logs/s.

Tracing:

Besides Error Reporting, you also need to trace your program flow to find out where the performance bottlenecks are; even more importantly, when an error occurs, you have a chance to find out how you did get there. In an ideal world, every function would have some tracing enabled with the function duration, passed parameters, and how far you did get into your function.