From 51a592ea409fc4bc3cedf7c4e0432622bfeba9f2 Mon Sep 17 00:00:00 2001 From: xxe Date: Sat, 19 Nov 2022 10:17:51 +0800 Subject: [PATCH] 1 --- HKCardOUT/Views/RootView.xaml.cs | 1 + HKLog/HKLogImport.cs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/HKCardOUT/Views/RootView.xaml.cs b/HKCardOUT/Views/RootView.xaml.cs index 15a0fb0..72d623d 100644 --- a/HKCardOUT/Views/RootView.xaml.cs +++ b/HKCardOUT/Views/RootView.xaml.cs @@ -18,6 +18,7 @@ namespace HKCardOUT.Views public RootView() { HKLogImport.Init("HKCardOUT"); + HKLogImport.WriteInfo("程序初始化"); InitializeComponent(); MessageLog.GetInstance.NotifyShow = new Action((s) => { diff --git a/HKLog/HKLogImport.cs b/HKLog/HKLogImport.cs index 76e6d9a..7791ace 100644 --- a/HKLog/HKLogImport.cs +++ b/HKLog/HKLogImport.cs @@ -7,10 +7,11 @@ namespace HKLog { public static void Init(string input) { + var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs",$"{input}.log"); //日志 Log.Logger = new LoggerConfiguration() .MinimumLevel.Information() - .WriteTo.File($"D:\\HK刷卡端正式环境\\Logs\\{input}.log", rollingInterval: RollingInterval.Day) + .WriteTo.File(path, rollingInterval: RollingInterval.Day) .CreateLogger(); } public static void WriteInfo(string msg)