From d0bc162f69f127d15852bb4a50552eba013a83ce Mon Sep 17 00:00:00 2001 From: dovholuknf <46322585+dovholuknf@users.noreply.github.com> Date: Fri, 27 Nov 2020 14:45:08 -0500 Subject: [PATCH] add a couple of extra lines to make it easy to find when the service/ui starts --- DesktopEdge/MainWindow.xaml.cs | 5 ++++- ZitiUpdateService/Program.cs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/DesktopEdge/MainWindow.xaml.cs b/DesktopEdge/MainWindow.xaml.cs index a1631b1e..cfa389bb 100644 --- a/DesktopEdge/MainWindow.xaml.cs +++ b/DesktopEdge/MainWindow.xaml.cs @@ -66,8 +66,10 @@ namespace ZitiDesktopEdge { var curdir = Path.GetDirectoryName(asm.Location); string nlogFile = Path.Combine(curdir, logname + "-log.config"); + bool byFile = false; if (File.Exists(nlogFile)) { LogManager.Configuration = new XmlLoggingConfiguration(nlogFile); + byFile = true; } else { var config = new LoggingConfiguration(); // Targets where to log to: File and Console @@ -87,7 +89,8 @@ namespace ZitiDesktopEdge { // Apply config LogManager.Configuration = config; } - logger.Info("service started - logger initialized"); + logger.Info("============================== UI started =============================="); + logger.Info("logger initialized using file? {0}", byFile); App.Current.MainWindow.WindowState = WindowState.Normal; App.Current.MainWindow.Closing += MainWindow_Closing; diff --git a/ZitiUpdateService/Program.cs b/ZitiUpdateService/Program.cs index e88a6a8c..512794e8 100644 --- a/ZitiUpdateService/Program.cs +++ b/ZitiUpdateService/Program.cs @@ -21,8 +21,10 @@ namespace ZitiUpdateService { var curdir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string nlogFile = Path.Combine(curdir, $"{logname}-log.config"); + bool byFile = false; if (File.Exists(nlogFile)) { LogManager.Configuration = new XmlLoggingConfiguration(nlogFile); + byFile = true; } else { var config = new LoggingConfiguration(); // Targets where to log to: File and Console @@ -42,7 +44,8 @@ namespace ZitiUpdateService { // Apply config LogManager.Configuration = config; } - Logger.Info("service started - logger initialized"); + Logger.Info("============================== ziti-monitor started =============================="); + Logger.Info("logger initialized using file? {0}", byFile); UpdateService updateSvc = new UpdateService(); updateSvc.AutoLog = true;