how to set up logging in subsonic 3.0

867 Views Asked by At

How do i set up subsonic to log out my sql queries and what will execute on my sql box?

1

There are 1 best solutions below

0
On

You can attach a Log writer to the Provider somehow like this

var provider = ProviderFactory.GetProvider("ApplicationServices");
var writer = new StreamWriter(
    File.Open(@"c:\temp\sqlqueries.txt", FileMode.Append, FileAccess.Write, FileShare.ReadWrite)
);
provider.Log = writer;
return new SimpleRepository(provider, SimpleRepositoryOptions.RunMigrations);