Database.Log Property
Set this property to log the SQL generated by the DbContext to the given delegate. For example, to log to the console, set this property to Write.
Assembly: EntityFramework (in EntityFramework.dll)
The format of the log text can be changed by creating a new formatter that derives from DatabaseLogFormatter and setting it with SetDatabaseLogFormatter. For more low-level control over logging/interception see IDbCommandInterceptor and DbInterception.