|
|
<?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"
|
|
|
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
|
|
|
autoReload="true"
|
|
|
throwExceptions="false"
|
|
|
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
|
|
|
|
|
|
<!-- optional, add some variables
|
|
|
https://github.com/nlog/NLog/wiki/Configuration-file#variables
|
|
|
-->
|
|
|
<variable name="variable1" value="${newline}date: ${date}${newline}level: ${level}${newline}logger: ${logger}${newline}machinename: ${machinename}
|
|
|
${newline}message: ${message} ${newline}exception:${exception}
|
|
|
${newline}appdomain: ${appdomain}${newline}assembly-version: ${assembly-version}${newline}basedir: ${basedir}
|
|
|
${newline}callsite: ${callsite}${newline}callsite-linenumber: ${callsite-linenumber}${newline}counter: ${counter}${newline}nlogdir: ${nlogdir}
|
|
|
${newline}processid: ${processid}${newline}processname: ${processname}${newline}specialfolder: ${specialfolder}
|
|
|
${newline}stacktrace: ${stacktrace}${newline}-----------------------------------------------------------" />
|
|
|
<variable name="variable2" value="日志时间:${longdate}${newline}日志来源:${callsite}${newline}日志级别:${uppercase:${level}}${newline}消息内容:${message}${newline}异常信息:${exception}${newline}stacktrace: ${stacktrace}${newline}==============================================================${newline}" />
|
|
|
<!--
|
|
|
See https://github.com/nlog/nlog/wiki/Configuration-file
|
|
|
for information on customizing logging rules and outputs.
|
|
|
-->
|
|
|
<targets>
|
|
|
<!--
|
|
|
Write events to a file with the date in the filename. -->
|
|
|
<!--<target xsi:type="File" name="f" fileName="${basedir}/logs/${shortdate}.log"
|
|
|
layout="${longdate} ${uppercase:${level}} ${message}" />-->
|
|
|
<target name="log_file" xsi:type="File" fileName="${basedir}/logs/${shortdate}.log" layout="${variable1}" />
|
|
|
<target name="log_file2" xsi:type="File" fileName="${basedir}/logs/${shortdate}.log" layout="${variable2}" />
|
|
|
</targets>
|
|
|
|
|
|
<rules>
|
|
|
<!-- add your logging rules here -->
|
|
|
<!--
|
|
|
Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f"
|
|
|
-->
|
|
|
<!--<logger name="*" minlevel="Debug" writeTo="f" />-->
|
|
|
<logger name="*" minlevel="Debug" writeTo="log_file" />
|
|
|
<logger name="*" minlevel="Info" writeTo="log_file2" />
|
|
|
<!--<logger name="*" writeTo="log_file2" />-->
|
|
|
</rules>
|
|
|
</nlog> |