Logging best practices

I’d like to get stories on how people are handling tracing and logging in real applications. Here are some questions that might help to explain your answer. Frameworks What frameworks do you use? log4net System.Diagnostics.Trace System.Diagnostics.TraceSource Logging application block Other? If you use tracing, do you make use of Trace.Correlation.StartLogicalOperation? Do you write this code … Read more

Exception Logging for WCF Services using ELMAH

We are using the excellent ELMAH to deal with unhandled exceptions in an ASP.NET 3.5 web application. This works extremely well for all of the site apart from WCF services which are being consumed using the REST features. When an exception occurs within the operation methods that is not handled by the application code, WCF handles it in various ways depending on the service contracts and configuration settings. This means that the exception does not end up firing the ASP.NET HttpApplication.Error event that ELMAH uses. The two solutions I am aware of to deal with this are: