I have an empty app.config file, but I still get NHibernate debug logs
NHibernate: SELECT this_.LogID as LogID71_0_, this_.Level as Level71_0_, this_.Message as Message71_0_, this_.EventTime as EventTime71_0_, this_.Component as ...
I tried adding a log4net configuration with an ERROR log level, but no use. How can I stop these log messages?
The thing I'm puzzled about is why do these appear in the first place if I have an empty app.config to being with. It doesn't make sense to me that I have to configure it not to print these messaages - the default should be off. Could it be my code is setting them on programatically somehow? What should I look for?
Configure Log4Net for use with NHibernate may be helpful.
You need to have both these loggers:
<logger name="NHibernate"> <level value="ERROR" /> </logger> <logger name="NHibernate.SQL"> <level value="ERROR" /> </logger>
return Fluently.Configure() .Database(MsSqlConfiguration.MsSql2005.ConnectionString( c => c.FromConnectionStringWithKey("MyDB")).ShowSql())
Removing the .ShowSql()
worked for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With