I would like to be able to log long running entity framework linq queries so I can investigate what is being generated. I have found that having an Entity Framework linq query and if I hover my mouse over it in the Visual Studio debugger, it shows me a string representation of the generated SQL that the entity framework will send to the SQL server.
I am wondering how it would be possible to get this string so I could print it out to a log file?