Explorar el Código

修复一个日志配置的问题,在每个小时切换过程中,日志有问题

tanghai hace 2 años
padre
commit
b5f5eaeaf2
Se han modificado 1 ficheros con 2 adiciones y 17 borrados
  1. 2 17
      Config/NLog/NLog.config

+ 2 - 17
Config/NLog/NLog.config

@@ -2,13 +2,10 @@
 
 <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 	<targets async="true">
+		<!-- 注意这里并没有开启bufferSize,上线要关闭Debug日志 -->
 		<target name="ServerDebug" xsi:type="File"
-				openFileCacheTimeout="10"
+				openFileCacheTimeout="30"
 				keepFileOpen="true"
-				archiveNumbering="Date"
-				archiveEvery="Hour"
-				archiveDateFormat="yyyyMMddHH"
-				archiveFileName="${basedir}/../Logs/${logger}.{#}.Debug.log"
 				fileName="${basedir}/../Logs/${logger}.${date:format=yyyyMMddHH}.Debug.log"
 				deleteOldFileOnStartup="false"
 				layout="${longdate} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2} ${message}" />
@@ -19,10 +16,6 @@
 				bufferSize="10240"
 				openFileCacheTimeout="30"
 				keepFileOpen="true"
-				archiveNumbering="Date"
-				archiveEvery="Hour"
-				archiveDateFormat="yyyyMMddHH"
-				archiveFileName="${basedir}/../Logs/${logger}.{#}.Info.log"
 				fileName="${basedir}/../Logs/${logger}.${date:format=yyyyMMddHH}.Info.log"
 				deleteOldFileOnStartup="false"
 				layout="${longdate} ${message}" />
@@ -33,10 +26,6 @@
 				bufferSize="10240"
 				openFileCacheTimeout="30"
 				keepFileOpen="true"
-				archiveNumbering="Date"
-				archiveEvery="Hour"
-				archiveDateFormat="yyyyMMddHH"
-				archiveFileName="${basedir}/../Logs/${logger}.{#}.Warn.log"
 				fileName="${basedir}/../Logs/${logger}.${date:format=yyyyMMddHH}.Warn.log"
 				deleteOldFileOnStartup="false"
 				layout="${longdate} ${message}" />
@@ -46,10 +35,6 @@
 		<target name="ServerError" xsi:type="File"
 				openFileCacheTimeout="10"
 				keepFileOpen="true"
-				archiveNumbering="Date"
-				archiveEvery="Hour"
-				archiveDateFormat="yyyyMMddHH"
-				archiveFileName="${basedir}/../Logs/${logger}.{#}.Error.log"
 				fileName="${basedir}/../Logs/${logger}.${date:format=yyyyMMddHH}.Error.log"
 				deleteOldFileOnStartup="false"
 				layout="${longdate} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2} ${message}" />