Question: I need to do a log of all SQL statements done. I'm using EF5 and this is my context constructor

```
public partial class Entities : ObjectContext
{
    public const string ConnectionString = "name=Entities";
    public const string ContainerName = "Entities";

    #region Constructors

    public Entities()
        : base(ConnectionString, ContainerName)
    {
        this.ContextOptions.LazyLoadingEnabled = true;
    }

```

**Update:**

This works fine for me: <http://efwrappers.codeplex.com/>

Answer: 
something like this:

```
context.Database.Log = Console.Write; 

```

for more info:

<http://msdn.microsoft.com/en-us/data/dn469464.aspx>
For those coming here at this point in time. You can now easily log EF queries by configuring an interceptor in your configuration:

```
<interceptors>
  <interceptor type="System.Data.Entity.Infrastructure.Interception.DatabaseLogger, EntityFramework">
    <parameters>
      <parameter value="C:\Temp\LogOutput.txt"/>
    </parameters>
  </interceptor>
</interceptors>

```

<https://learn.microsoft.com/en-us/ef/ef6/fundamentals/configuring/config-file>