In general you can hook up the built-in tracer or any logger by simple
context.Database.Log = msg => Trace.WriteLine(msg);
in the DbContext constructor.
See more in MSDN. Some other approaches from MS are here (all based on DataContext.Log property).
Talking about the Clutch solution mentioned by Nate, it doesn’t work with EF v6 (see this bug-report).
REFERENCES
- Logging and Intercepting Database Operations (EF6 Onwards)
- Logging and Intercepting Database Operations