NHibernate has a very extensible logging mechanism, and provides a
log4net log provider out of the box. The log4net library is a highly customizable, open source logging framework. In this recipe, we'll show you a simple log4net configuration to log important NHibernate events to the Visual Studio debug output window.
Complete the earlier Configuring NHibernate with App.config or Web.config recipe.
log4netusing NuGet Package Manager.
configSectionselement, declare a section for the log4net configuration:
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>