Sample log4net configuration file using MsmqAppender

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <!-- Other sections -->
    <section name="log4net"
    type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
  </configSections>

  <!-- Some other configurations -->

  <!-- This section contains the log4net configuration settings -->
  <log4net debug="false">

    <appender name="MsmqAppender" type="NHTrace.Appenders.MsmqAppender, NHTrace.Appenders">
      <queueName value=".\Private$\nhtrace" />
      <labelLayout value="LOG [%level] %date" />
      <layout type="log4net.Layout.XmlLayoutSchemaLog4j" />
    </appender>
    
    <!-- Setup the root category, add the appenders and set the default priority -->
    <root>
      <priority value="DEBUG" />
      <appender-ref ref="MsmqAppender" />
    </root>

    <logger name="NHibernate">
      <level value="WARN" />
    </logger>

    <logger name="NHibernate.SQL">
      <level value="DEBUG" />
    </logger>
  </log4net>
</configuration>

Last edited May 16, 2010 at 11:36 PM by jorgerowies, version 1

Comments

No comments yet.