log4net代码配置

webconfig 里的配置!
  <log4net>
    <logger name="myLogger">
      <level value="All" />
      <appender-ref ref="AdoNetAppender_SqlServer" />
    </logger>
    <appender name="AdoNetAppender_SqlServer" type="log4net.Appender.AdoNetAppender">
      <!-- BufferSize 涓虹紦鍐插尯澶у皬锛屽彧鏈夋棩蹇楄褰曡秴5 鏉℃墠浼氫竴鍧楀啓鍏ュ埌鏁版嵁搴?-->
      <!-- 鎴栧啓涓?param name="BufferSize" value="10" /> -->
      <bufferSize value="50" />
      <!-- 寮曠敤 -->
      <!--2.0杩欐槸瀵瑰簲sql2008 濡傛槸2000鎴?005鍙﹀閰嶇疆-->
      <connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089" />
      <!-- 杩炴帴鏁版嵁搴撳瓧绗︿覆 -->
      <connectionString value="Data Source=.\SQLEXPRESS;Initial Catalog=CaseManage;User ID=sa;Password=1234" />
      <!-- 鎻掑叆鍒拌〃Log -->
      <commandText value="INSERT INTO X_Log ([TIMESTAMP],[EVENTCATEGORY],[COMPUTERNAME],[MAC_ADDRESS],[USERNAME],[SOURCE],[DESCRIPTION],[COLLECTDATE]) VALUES (@log_date, @EventCategory, @ComputerName,@Mac_Address,@UserName,@Source,@Description,@CollectDate) " />
      <!-- 鏃ュ織绫诲瀷锛岃繖閲屽潎涓? -->
      <!-- 鏃ュ織璁板綍鏃堕棿锛孯awTimeStampLayout 涓洪粯璁ょ殑鏃堕棿杈撳嚭鏍煎紡 -->
      <parameter>
        <parameterName value="@log_date" />
        <dbType value="DateTime" />
        <layout type="log4net.Layout.RawTimeStampLayout" />
        <!-- /杩欓噷鍛㈡槸鑾峰彇log4net 涓彁渚涚殑鏃ュ織鏃堕棿 -->
      </parameter>
      <!-- 鏃ュ織鍒嗙被鎻忚堪 -->
      <parameter>
        <parameterName value="@EventCategory" />
        <dbType value="String" />
&