NLog.Config的配置示例
示例:
<targets> <target xsi:type="File" name="errorFile" fileName="${basedir}/logs/${shortdate}_Error.log" layout="${time} ${uppercase:${level}} ${message}" /> <target xsi:type="File" name="debugFile" fileName="${basedir}/logs/${shortdate}_Debug.log" layout="${time} ${uppercase:${level}} ${message}" /> <target xsi:type="ColoredConsole" name="console" layout="${time} ${uppercase:${level}} ${message}" /> </targets> <rules> <logger name="*" minlevel="Error" writeTo="errorFile" /> <logger name="*" minlevel="Debug" writeTo="debugFile" /> <logger name="*" minlevel="Trace" writeTo="console"/> </rules>