So today i stumbled upon a Linq to SQL feature i didn’t know of but thought it could be useful. Linq to SQL allows you to attach a logger to the DataContext object. You can quickly log to the Output window with the following code
MyDataContext dataContext = new MyDataContext(connectionString); dataContext.Log = new DebugTextWriter();
Here is a useful blog i found with some other useful logging tips including custom loggers and logging to multiple loggers.