Pārlūkot izejas kodu

nlog日志目录调整

Murphy 2 gadi atpakaļ
vecāks
revīzija
9ddc4a8da3
1 mainītis faili ar 4 papildinājumiem un 4 dzēšanām
  1. 4 4
      MicroServices/Business/Business.Host/nlog.config

+ 4 - 4
MicroServices/Business/Business.Host/nlog.config

@@ -4,7 +4,7 @@
       autoReload="true"
 	  throwExceptions="true"
       internalLogLevel="Info"
-      internalLogFile="${gdc:item=appbasepath}\log\internal-nlog.txt">
+      internalLogFile="Logs/internal-nlog.txt">
 	<extensions>
 		<add assembly="NLog.Web.AspNetCore"/>
 	</extensions>
@@ -15,8 +15,8 @@
 		<!--把日志输出到控制台 -->
 		<target xsi:type="Console" name="lifetimeConsole" layout="${level:truncate=4:tolower=true}: ${logger}[0]${newline}      ${message}${exception:format=tostring}" />
 		<!-- 把日志记录到文件(通用) -->
-		<target xsi:type="File" name="allfile" fileName="${gdc:item=appbasepath}\logs\nlog-${shortdate}.log" encoding="UTF-8"
-            archiveFileName="${gdc:item=appbasepath}\logs\nlog-${shortdate}.{#}.log" archiveAboveSize="10485760"
+		<target xsi:type="File" name="allfile" fileName="Logs/nlog-${shortdate}.log" encoding="UTF-8"
+            archiveFileName="/Logs/nlog-${shortdate}.{#}.log" archiveAboveSize="10485760"
             layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />
 		<!--把日志输出到数据库 -->
 		<!--<target xsi:type="Database" name="database" dbProvider="MySqlConnector.MySqlConnection, MySqlConnector" connectionString="${configsetting:item=ConnectionStrings.DOPLog}">
@@ -105,6 +105,6 @@
 		<logger name="Microsoft.*" maxlevel="Info" final="true" />
 		<logger name="System.Net.Http.*" maxlevel="Info" final="true" />
 
-		<logger name="*" minlevel="Trace" writeTo="allfile,database" />
+		<logger name="*" minlevel="Info" writeTo="allfile,database" />
 	</rules>
 </nlog>