diff --git a/DesktopEdge/MainWindow.xaml.cs b/DesktopEdge/MainWindow.xaml.cs index 16eae515..e0095a28 100644 --- a/DesktopEdge/MainWindow.xaml.cs +++ b/DesktopEdge/MainWindow.xaml.cs @@ -824,9 +824,5 @@ namespace ZitiDesktopEdge { ServiceStatusEvent resp = await monitorClient.CaptureLogsAsync(); logger.Info("response: {0}", resp.Message); } - - private void Button_Click(object sender, RoutedEventArgs e) { - - } } } \ No newline at end of file diff --git a/Installer/collect-logs.ps1 b/Installer/collect-logs.ps1 index c74c18f9..11e5af61 100644 --- a/Installer/collect-logs.ps1 +++ b/Installer/collect-logs.ps1 @@ -11,7 +11,7 @@ $now=(Get-Date).ToString('yyyy-MM-dd_HHmmss') $logroot="${env:ProgramFiles(x86)}\NetFoundry, Inc\Ziti Desktop Edge\logs" $ipinfo="${logroot}\ipconfig.info.txt" -$logdest="$logroot\ziti-service\$now" +$logdest="$logroot\ziti-service\" $logdest $logsrc="C:\Windows\System32\config\systemprofile\AppData\Roaming\NetFoundry\*.log" $destArchive="${logroot}\logs-${now}.zip" diff --git a/ZitiUpdateService/UpdateService.cs b/ZitiUpdateService/UpdateService.cs index 0bb97c73..fbfc41a8 100644 --- a/ZitiUpdateService/UpdateService.cs +++ b/ZitiUpdateService/UpdateService.cs @@ -56,6 +56,40 @@ namespace ZitiUpdateService { } private string GetLogs() { + + /* + string logLocation = Path.Combine(exeLocation, "logs"); + string destinationLocation = Path.Combine(exeLocation, "temp"); + string serviceLogsLocation = Path.Combine(Environment.GetEnvironmentVariable("APPDATA"), "NetFoundry"); + string serviceLogsDest = Path.Combine(destinationLocation, "services"); + + Logger.Debug("removing temp folder: {0}", destinationLocation); + try { + Directory.Delete(destinationLocation, true); + } catch(Exception ex) { + //means it doesn't exist + } + + Directory.CreateDirectory(destinationLocation); + + Logger.Debug("copying all directories from: {0}", logLocation); + foreach (string dirPath in Directory.GetDirectories(logLocation, "*", SearchOption.AllDirectories)) { + Directory.CreateDirectory(dirPath.Replace(logLocation, destinationLocation)); + } + + Logger.Debug("copying all non-zip files from: {0}", logLocation); + foreach (string newPath in Directory.GetFiles(logLocation, "*.*", SearchOption.AllDirectories)) { + if (!newPath.EndsWith(".zip")) { + File.Copy(newPath, newPath.Replace(logLocation, destinationLocation), true); + } + } + + Logger.Debug("copying service files from: {0} to {1}", serviceLogsLocation, serviceLogsDest); + Directory.CreateDirectory(serviceLogsDest); + foreach (string newPath in Directory.GetFiles(serviceLogsLocation, "ziti-tunnel.*", SearchOption.AllDirectories)) { + File.Copy(newPath, newPath.Replace(serviceLogsLocation, serviceLogsDest), true); + }*/ + Logger.Info("Request to collect logs received"); var ps = System.Management.Automation.PowerShell.Create(); string script = Path.Combine(exeLocation, "collect-logs.ps1"); @@ -90,9 +124,12 @@ namespace ZitiUpdateService { addLogsFolder(Path.Combine(logs, "ZitiMonitorService")); addLogsFolder(Path.Combine(logs, "service")); + Logger.Info("starting ipc server"); ipcServer = svr.startIpcServer(); + Logger.Info("starting events server"); eventServer = svr.startEventsServer(); + Logger.Info("starting service watchers"); if (!running) { running = true; Task.Run(() => { diff --git a/release-notes.md b/release-notes.md index d6ef5d4e..0fb95759 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,7 +1,7 @@ # Release 1.5.10 ## What's New -* none - bugfix only +* fixes [#201](https://github.com/openziti/desktop-edge-win/issues/201) - Feedback menu item will collect all logs ## Other changes: * none