Last active
May 24, 2019 10:11
-
-
Save MinChanSike/b33b85c7dca81c43f198797f4f49ce26 to your computer and use it in GitHub Desktop.
NLog configuration to export as file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
autoReload="true"> | |
<variable name="defaultLayout" value="${longdate}|${uppercase:${level}}|${logger}|${message}${onexception:${newline}${exception:format=tostring}}" /> | |
<targets> | |
<target xsi:type="File" name="File" fileName="${basedir}/logs/WebAppAuth.log" | |
archiveEvery="Day" | |
archiveDateFormat="yyyy-MM-dd" | |
archiveNumbering="Date" | |
maxArchiveFiles ="365" | |
concurrentWrites="true" | |
keepFileOpen="false"> | |
<layout xsi:type="CsvLayout"> | |
<quoting>Auto</quoting> | |
<withHeader>true</withHeader> | |
<delimiter>Tab</delimiter> | |
<column name="DateTime" layout="${longdate}" /> | |
<column name="Serverity" layout="${uppercase:${level}}" /> | |
<column name="Category" layout="${logger}" /> | |
<column name="Message" layout="${message}" /> | |
<column name="Exception" layout="${exception:format=tostring}" /> | |
</layout> | |
</target> | |
<target xsi:type="Debugger" name="Debugger" layout="${defaultLayout}" /> | |
<target xsi:type="Console" name ="Console" layout="${defaultLayout}" /> | |
</targets> | |
<rules> | |
<logger name="*" minlevel="Trace" writeTo ="File,Console"/> | |
</rules> | |
</nlog> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/NLog/NLog/wiki/Tutorial