• NLog.config


     1 <?xml version="1.0" encoding="utf-8"?>
     2 <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
     3       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     4       autoReload="true" internalLogLevel="Warn" internalLogFile="logs/internalLog.log">
     5   <variable name="logDirectory" value="${basedir}/logs/${shortdate}"/>
     6   <targets async="true">
     7     <default-target-parameters
     8       xsi:type="File"
     9       keepFileOpen="true"
    10       encoding="Utf-8"
    11       archiveAboveSize="10240000"
    12       archiveDateFormat="yyyyMMddHH"
    13       archiveNumbering="DateAndSequence"
    14       layout="${longdate}|${level:uppercase=false:padding=-5}|${callsite}:${callsite-linenumber}|${message} ${onexception:${exception:format=tostring}${newline}${newline}}"
    15     />
    16     <default-target-parameters
    17       xsi:type="ColoredConsole"
    18       detectConsoleAvailable="true"
    19       layout="${longdate}|${level:uppercase=false:padding=-5}|${callsite}:${callsite-linenumber}|${message} ${onexception:${exception:format=tostring}${newline}${newline}}"
    20     />
    21     <target name="console" xsi:type="ColoredConsole"/>
    22     <target name="default" xsi:type="File"
    23             fileName="${logDirectory}_default.log"
    24             archiveFileName="${logDirectory}/default_{#}.log"
    25     />
    26   </targets>
    27   <rules>
    28     <logger name="*" maxlevel="Debug" writeTo="default,console" >
    29       <filters>
    30         <when condition="!contains('CN-L-6683748,CN-S-VDNET40','${machinename}')" action="Ignore" />
    31       </filters>
    32     </logger>
    33     <logger name="*"  minlevel="Info" writeTo="default,console"/>
    34     <!--<logger name="*" writeTo="console"/>-->
    35   </rules>
    36 </nlog>
  • 相关阅读:
    清空数据库所有表数据
    sqlserver编号
    Inherits、CodeFile、CodeBehind的区别
    初识NuGet
    ASP.Net各个命名空间及作用
    SQL SERVER数据库性能优化之SQL语句篇
    Exercise 20: Functions And Files
    Exercise 19: Functions And Variables
    Exercise 18: Names, Variables, Code, Functions
    Exercise 17: More Files
  • 原文地址:https://www.cnblogs.com/lizhanglong/p/8990398.html
Copyright © 2020-2023  润新知