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>

'C#' 카테고리의 다른 글

log4net.config 예제  (0) 2019.08.03
GDI+ Bitmap Rotaion  (0) 2019.02.19
WPF RichText에서 HTML 표시하기  (0) 2019.02.09
Visual Studio Debug.WriteLine 표시가 안될때 대처 방안  (0) 2018.11.15
WPF, Template Select 하기  (0) 2018.05.29
WPF MVVM 샘플코드  (0) 2018.05.28

+ Recent posts