To show the SQL in the output window of Visual Studio, configure log4net to use TraceAppender in your log4net config. This:
<appender name="DebugSQL" type="log4net.Appender.TraceAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>
Then this:
<logger name="NHibernate.SQL" additivity="false">
<level value="DEBUG" />
<appender-ref ref="DebugSQL" />
</logger>
EDIT: I can't seem to format this correctly here. See this link for code example
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…