项目中经常用到的配置文件模板,在这里做一下记录,也方便给大家查看,直接上代码:
已用过很多次了。
具体解释,请参考其他文章,网上已经写的很详尽了。
直接拿去使用,不谢:
<?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">
<targets>
<target name="console" xsi:type="ColoredConsole"
layout= "$[${date:format=yyyy-MM-dd HH\:mm\:ss}] [${uppercase:${level}}] [${logger}] [${callsite}]: ${message}"/>
<target name="file" xsi:type="File"
fileName="${basedir}/Logs/${date:format=yyyy}/${date:format=MM}/${shortdate}.log"
layout="[${date:format=yyyy-MM-dd HH\:mm\:ss}] [${uppercase:${level}}] [${callsite}]: ${message}"
keepFileOpen