views:

22

answers:

0

Currently I'm assigning a TextWriter to the Log property of my Linq to Sql data context (per request instancing) and write this to my logging when an exception is thrown while executing a stored procedure (is strongly typed mapped in the context, so not executing a custom command)

however when using ADO.NET we normally inspect the SqlCommand upon unhandled exception to read out the parameters and log them

is it possible to access the SqlCommand that was used for executing a Stored Procedure in L2S so we can reuse that existing logging component? This would be far nicer than the current Log TextWriter solution....