开发者

how to set up logging in subsonic 3.0

开发者 https://www.devze.com 2023-02-13 16:42 出处:网络
How do i set up subsonic 开发者_如何学Pythonto log out my sql queries and what will execute on my sql box?You can attach a Log writer to the Provider somehow like this

How do i set up subsonic 开发者_如何学Pythonto log out my sql queries and what will execute on my sql box?


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);
0

精彩评论

暂无评论...
验证码 换一张
取 消