Default log4net.config

<< Click to Display Table of Contents >>

Raynet One Data Hub > 14.0 u1 > Installation Guide > Data Hub > Windows > Configuration > Logging 

Default log4net.config

<log4net debug="true">

  <appender name="Console" type="log4net.Appender.ConsoleAppender">

    <layout type="log4net.Layout.PatternLayout">

      <!-- Pattern to output the caller's file name and line number -->

      <conversionPattern value="%date %5level %logger.%method [%line] - MESSAGE: 

        %message%newline %exception" />

    </layout>

  </appender>

 

  <appender name="AdoNetAppender" type="MicroKnights.Logging.AdoNetAppender, 

    MicroKnights.Log4NetAdoNetAppender">

    <bufferSize value="1" />

    <connectionType value="System.Data.SqlClient.SqlConnection,System.Data.SqlClient,

      Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089" />

    <reconnectonerror value="true" />

    <commandText value="INSERT INTO SystemLog ([Date],[Thread],[Level],[Logger],

      [Message],[Exception]) VALUES (@log_date, @thread, @log_level, @logger, 

      @message, @exception)" />

    <parameter>

      <parameterName value="@log_date" />

      <dbType value="DateTime" />

      <layout type="log4net.Layout.RawUtcTimeStampLayout" />

    </parameter>

    <parameter>

      <parameterName value="@thread" />

      <dbType value="String" />

      <size value="255" />

      <layout type="log4net.Layout.PatternLayout">

        <conversionPattern value="%thread" />

      </layout>

    </parameter>

    <parameter>

      <parameterName value="@log_level" />

      <dbType value="String" />

      <size value="50" />

      <layout type="log4net.Layout.PatternLayout">

        <conversionPattern value="%level" />

      </layout>

    </parameter>

    <parameter>

      <parameterName value="@logger" />

      <dbType value="String" />

      <size value="255" />

      <layout type="log4net.Layout.PatternLayout">

        <conversionPattern value="%logger" />

      </layout>

    </parameter>

    <parameter>

      <parameterName value="@message" />

      <dbType value="String" />

      <size value="4000" />

      <layout type="log4net.Layout.PatternLayout">

        <conversionPattern value="%message" />

      </layout>

    </parameter>

    <parameter>

      <parameterName value="@exception" />

      <dbType value="String" />

      <size value="2000" />

      <layout type="log4net.Layout.ExceptionLayout" />

    </parameter>

  </appender>

 

  <appender name="RollingFile" type="log4net.Appender.RollingFileAppender">

    <file value="logs/RayVentoryDataHubService.log" />

    <appendToFile value="true" />

    <maximumFileSize value="1000KB" />

    <maxSizeRollBackups value="2" />

    <layout type="log4net.Layout.PatternLayout">

      <param name="header" value="/***************************** LOG HEADER 

        *****************************/ &#13;&#10;" />

      <param name="footer" value="/***************************** LOG FOOTER 

        *****************************/ &#13;&#10;" />

      <conversionPattern value="%date %5level %logger.%method [%line] - MESSAGE: 

        %message%newline %exception" />

    </layout>

  </appender>

 

  <root>

    <level value="OFF" />

    <appender-ref ref="AdoNetAppender" />

    <appender-ref ref="RollingFile" />

  </root>

</log4net>