Disable NHibernate logging

Viewed 19919

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?

7 Answers
return Fluently.Configure()
            .Database(MsSqlConfiguration.MsSql2005.ConnectionString(
                c => c.FromConnectionStringWithKey("MyDB")).ShowSql())

Removing the .ShowSql() worked for me

Related