-
Notifications
You must be signed in to change notification settings - Fork 15
Home
The only NHibernate configuration automatically overridden is the LoggerFactory (in appSettings). This was primarily to avoid a dependency on Log4Net.
By default, SQL, IDbCommand, IDataReader, IDbConnection, IDbTransaction, entity load, and flush logging is provided.
Add this appSettings key and value to enable the logging sinks. Note: this setting is added automatically if installed via NuGet.
<add key="NHibernate.Glimpse.Loggers" value="command,connection,flush,load,transaction"/>
Add this NHibernate SessionFactory configuration property to make the SQL pretty ;)
<property name="format_sql">true</property>
Add this NHibernate SessionFactory configuration property to track factory statistics.
<property name="generate_statistics">true</property>
You also need to register the factory after building it.
NHibernate.Glimpse.Plugin.RegisterSessionFactory(YourSessionFactory);