I have an application that uses both Entity Framework and Dapper. I would like to provide a custom logger to log out any sql that is issued over the ado.net connection. What is the best way of doing this?
Alternately, if it's not easily possible what exactly are the difficulties?
Would ADO.NET Data Tracing work for you? It plugs into ETW, from which you might be able to glue your current logging system. Doesn't seem much stand-alone though.
Miniprofiler, which is written by the same team, works with both dapper and Entity Framework - although iirc the later requires a bit more work. This provides the ability for both logging and profiling of ADO.NET commands. We use it 24x7 here on stackoverflow (and the entire stack exchange network), so it works well even at scale.