We're using NHibernate 3.2.
I'd like to be able to log SQL queries from a specific ISession. Is that possible?
Alternatively, if that is not possible, could I set a logger to a specific ISessionFactory? Then I could create this ISession from this specific factory.
From what I saw, to set the logger, you have to do something like that:
<appSettings>
<add key="nhibernate-logger" value="NH3SQLLogger.LoggerFactory, NH3SQLLogger" />
</appSettings>
However, that would make the setting global for all the factories.
Could I do something like that:
var config = new Configuration();
config.Configure();
config.SetProperty("nhibernate-logger",
"NH3SQLLogger.LoggerFactory, NH3SQLLogger");
_sessionFactory = config.BuildSessionFactory();
Would that work? Or is there another way?