开发者

NHibernate not outputting SQL to console

开发者 https://www.devze.com 2023-01-19 17:41 出处:网络
I have configured NHibernate to output the SQL it generates to the console. I have added the following to the app.config of the DLL contai开发者_JAVA技巧ning the integration tests I want to run from N

I have configured NHibernate to output the SQL it generates to the console. I have added the following to the app.config of the DLL contai开发者_JAVA技巧ning the integration tests I want to run from NUnit:

  <configSections>
    <section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  </configSections>
  <nhibernate>
    <add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
    <add key="hibernate.show_sql" value="true" />
  </nhibernate>

However, the SQL is still not being output to Console.Out. Can anyone think of another setting I might need to set to view the SQL resulting from my NHibernate queries?


Did you try using a sepparate xml config? http://nhibernate.info/doc/howto/various/configure-log4net-for-use-with-nhibernate.html

0

精彩评论

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