我正在使用NLog进行日志记录.
我的代码如下:
<?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">
<!-- make sure to set 'Copy To Output Directory' option for this file -->
<!-- go to http://nlog-project.org/wiki/Configuration_file for more information -->
<targets>
<target
name="logfile"
xsi:type="File"
layout="${message}"
fileName="${basedir}../Data/debugLog1.txt"
archiveAboveSize ="5000000"
maxArchiveFiles="2"/>
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="logfile" />
</rules>
</nlog>
Run Code Online (Sandbox Code Playgroud)
我正在记录数据debugLog1.txt.现在从项目的另一个位置我也想记录数据,但这个数据是另一种类型,所以我想制作一个debugLog2.txt并记录数据.如何修改上面的代码来执行此操作