Sample log4net configuration file using MsmqAppender

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

  <!-- 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" />
    <!-- Setup the root category, add the appenders and set the default priority -->
      <priority value="DEBUG" />
      <appender-ref ref="MsmqAppender" />

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

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

Last edited May 17, 2010 at 12:36 AM by jorgerowies, version 1


No comments yet.