| | |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.Extensions.Hosting; |
| | | using Microsoft.OpenApi.Models; |
| | | using NLog; |
| | | using Rhea.Common; |
| | | using Sundial; |
| | | using System; |
| | |
| | | BizConfig.InitConfig(bizConfig, DI.Resolve<ILanguage>().GetDictionary()); |
| | | |
| | | //加载配置文件 |
| | | NLog.LogManager.LoadConfiguration("nlog.config").GetCurrentClassLogger(); |
| | | NLog.LogManager.Setup().LoadConfigurationFromFile("nlog.config").GetCurrentClassLogger(); |
| | | app.UseMiddleware<LogMiddleware>(); |
| | | |
| | | app.UseSwagger(); |
| | |
| | | /// </summary> |
| | | public void DeleteLogs() |
| | | { |
| | | DirectoryInfo di = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory + "\\Logs"); |
| | | DirectoryInfo di = new (AppDomain.CurrentDomain.BaseDirectory + "\\Logs"); |
| | | if(di.Exists) |
| | | { |
| | | var logFiles = di.GetFiles("*.log", SearchOption.AllDirectories); |