Search code examples
.netsimple.data

How to log generated sql queries out of Simple.Data ORM for .NET


How to log generated sql queries (without mysql profiler)?

I'm using Simple.Data.Mysql


Solution

  • You have a couple of choices here. You can either set up a trace listener like this and then yes it will show up in the VS output window.

    <configuration>
       <system.diagnostics>
          <switches>
             <add name="Simple.Data" value="Info" />
          </switches>
       </system.diagnostics>
    </configuration>
    

    Or you can also have a look at the ExampleRunner and ExampleTestListener classes in Simple.Data.Sample for an example of setting it up in code.