Answers for "NLog how to wirte to console and file at the sam etime"

0

NLog how to wirte to console and file at the sam etime

<logger name="*" minlevel="Debug" writeTo="console" />
<logger name="*" minlevel="Debug" writeTo="debugger" />
<logger name="*" minlevel="Debug" writeTo="FullCSVFile" />
Posted by: Guest on November-06-2020
0

NLog how to wirte to console and file at the sam etime

<target name="debugger" xsi:type="Debugger" layout="${level}>${message} (${exception:format=ToString})"/>
<target name="console" xsi:type="ColoredConsole" layout="${date:format=dd-MM-yyyy HH\:mm\:ss} - ${message}" />
<target name="FullCSVFile" xsi:type="File"  fileName="${specialfolder:folder=LocalApplicationData}\YourApp\YourApp-${date:format=yyyy-MM-dd}.csv">
  <layout xsi:type="CsvLayout">
    <column name="Index" layout="${counter}" />
    <column name="ThreadID" layout="${threadid}" />
    <column name="Time" layout="${longdate}" />
    <column name="Severity" layout="${level:uppercase=true}" />
    <column name="Location" layout="${callsite:className=False:fileName=True:includeSourcePath=False:methodName=False}" />
    <column name="Detail" layout="${message}" />
    <column name="Exception" layout="${exception:format=ToString}" />
  </layout>
</target>
Posted by: Guest on November-06-2020

Code answers related to "NLog how to wirte to console and file at the sam etime"

Browse Popular Code Answers by Language