EF6 Logging (edit)

  • Logging Database Operations
  • Log to file

Database command logging in Entity Framework (entityframeworktutorial.net)

EF6 SQL Logging - Part 1: Simple Logging | 1unicorn2 (oneunicorn.com)

EF6 SQL Logging – Part 2: Changing the content/formatting | 1unicorn2 (oneunicorn.com)

EF 6.1: Turning on logging without recompiling | 1unicorn2 (oneunicorn.com)

Web.config

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

</configuration>