D:\Logs\2019\20190803\LOG_A_20190803.txt 형식으로 작성이 된다.

 

<?xml version="1.0" encoding="utf-8" ?>

<log4net>

  <appender name="DebugAppender" type="log4net.Appender.DebugAppender" >

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

      <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />

    </layout>

  </appender>

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

    <file type="log4net.Util.PatternString" value="D:\Logs\%date{yyyy}\%date{yyyy}%date{MM}%date{dd}\LOG_" />

    <datePattern value="'A_'yyyyMMdd'.txt'" />

    <param name="AppendToFile" value="true" />

    <param name="rollingStyle" value="Date" />

    <staticLogFileName value="false" />

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

      <param name="conversionPattern" value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />

    </layout>

  </appender>

  <root>

    <level value="ALL"/>

    <appender-ref ref="DebugAppender" />

    <appender-ref ref="RollingLogFileAppender" />

  </root>

</log4net>

+ Recent posts