Log4netConfiguration.xml

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
  </configSections>
  <log4net>
    <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
        <file type="log4net.Util.PatternString" value="%property{DirectoryBase}\\%date{yyyy-MM}\\.log" />
         
        <appendToFile value="true" />
        <PreserveLogFileNameExtension value="true" />
        <rollingStyle value="Date" />
        <!-- <staticLogFileName value="true" /> -->
        <staticLogFileName value="false" />
        <datePattern value="yyyy-MM-dd" />
        <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%date{yyyy-MM-dd HH:mm:ss.fffzzz}|%-5level|%logger|%property{NDC}|%message%newline" />
        </layout>
    </appender>
    <appender name="FileAppender-biz.dfch.PS.System.Logging" type="log4net.Appender.FileAppender">
        <file type="log4net.Util.PatternString" value="%property{DirectoryBase}\\%date{yyyy-MM}\\%date{yyyy-MM-dd}.log" />
        <appendToFile value="true" />
        <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
        <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%date{yyyy-MM-dd HH:mm:ss.fffzzz}|%message%newline" />
        </layout>
    </appender>
    <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date{yyyy-MM-dd HH:mm:ss.fffzzz}|%message%newline" />
      </layout>
    </appender>
    <appender name="GelfUdpAppender" type="gelf4net.Appender.GelfUdpAppender, gelf4net">
      <remoteAddress value="192.168.60.130"/>
      <remotePort value="12201" />
      <layout type="Gelf4net.Layout.GelfLayout, Gelf4net">
        <param name="AdditionalFields" value="app:RandomSentence,version:1.0,Level:%level" />
        <param name="Facility" value="RandomPhrases" />
        <param name="IncludeLocationInformation" value="true"/>
        <!-- Sets the full_message and short_message to the specified pattern-->
        <!--<param name="ConversionPattern" value="[%t] %c{1} - %m" />-->
      </layout>
    </appender>
    <appender name="GelfUdpHostNameAppender" type="gelf4net.Appender.GelfUdpAppender, gelf4net">
      <remoteHostName value="my.graylog2.local"/>
      <remotePort value="12201" />
      <layout type="Gelf4net.Layout.GelfLayout, Gelf4net">
        <param name="AdditionalFields" value="app:RandomSentence,version:1.0,Level:%level" />
        <param name="Facility" value="RandomPhrases" />
        <param name="IncludeLocationInformation" value="true"/>
        <!-- Sets the full_message and short_message to the specified pattern-->
        <!--<param name="ConversionPattern" value="[%t] %c{1} - %m" />-->
      </layout>
    </appender>
    <appender name="GelfAmqpAppender" type="gelf4net.Appender.GelfAmqpAppender, gelf4net">
      <remoteAddress value="192.168.60.130" />
      <remotePort value="5672" />
      <username value="guest" />
      <password value="guest" />
      <virtualHost value="/" />
      <exchange value="sendExchange" />
      <key value="key" />
      <layout type="Gelf4net.Layout.GelfLayout, Gelf4net">
        <param name="AdditionalFields" value="app:RandomSentence,version:1.0,Level:%level" />
        <param name="Facility" value="RandomPhrases" />
        <param name="IncludeLocationInformation" value="true"/>
        <!-- Sets the full_message and short_message to the specified pattern-->
        <!--<param name="ConversionPattern" value="[%t] %c{1} - %m" />-->
      </layout>
    </appender>
 
    <logger name="biz.dfch.PS.System.Logging" additivity="False">
        <level value="ALL" />
        <appender-ref ref="FileAppender-biz.dfch.PS.System.Logging" />
    </logger>
    <logger name="Esacalated" additivity="False">
        <level value="ERROR" />
        <appender-ref ref="ConsoleAppender" />
        <!-- <appender-ref ref="EventLogAppender" /> -->
    </logger>
  </log4net>
</configuration>