끌림

C# Nlog 본문

Programming/C#

C# Nlog

소닉럽 2018. 7. 20. 14:54

 

Nlog.config

 

file 설정 관련 링크

 

https://github.com/nlog/NLog/wiki/File-target

 

<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <targets>
    <target name="file" xsi:type="File"
        layout="[${longdate}] ${message}"
        fileName="${basedir}/logs/${shortdate}.log"
        keepFileOpen="false" maxArchiveFiles="10" archiveNumbering="Sequence" archiveAboveSize="1048576"
        encoding="utf-8" />
    <target name="console" xsi:type="Console" layout="${message}" />
  </targets>

  <rules>
    <logger name="*" minlevel="Debug" writeTo="file,console" />
  </rules>
</nlog> 

 

Comments