I've configured nHibernate to output its SQL statements to the Visual Studio output window using the following configuration code:
var configuration = Fluently.Configure(cfg)
.Database(
MsSqlConfiguration.MsSql2005
.ConnectionString(connectionString)
.DefaultSchema("dbo")
.UseReflectionOptimizer()
.AdoNetBatchSize(32)
.ShowSql()
and in my Web.config:
<appender name="NHibernateFileLog" type="log4net.Appender.TraceAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%d{HH:mm:ss.fff} [%t] %-5p %c - %m%n" />
</layout>
</appender>
<logger name="NHibernate.SQL" additivity="false">
<level value="DEBUG"/>
<appender-ref ref="NHibernateFileLog"/>
</logger>
Will this have any performance impact on the live system? The log level on the live system is ERROR so I guess that means the logger won't be switched on, but will the ShowSql on my nHibernate configuration still use up resources?