From 435d8b61614200cead4ae177b14655339170948b Mon Sep 17 00:00:00 2001 From: Craig Hawker Date: Mon, 10 Nov 2025 13:45:10 +0000 Subject: [PATCH] Improved situation with multiple log files with overlapping timestamps. Added note to log viewer to use raw log files as preference. --- .../ShowLatestLogEntriesDashboardCommand.cs | 13 +++++++++++++ .../Resources/DisplayLatestLogEntries.html | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/MFiles.VAF.Extensions/Dashboards/Commands/ShowLatestLogEntriesDashboardCommand.cs b/MFiles.VAF.Extensions/Dashboards/Commands/ShowLatestLogEntriesDashboardCommand.cs index 056bbff3..8101d70c 100644 --- a/MFiles.VAF.Extensions/Dashboards/Commands/ShowLatestLogEntriesDashboardCommand.cs +++ b/MFiles.VAF.Extensions/Dashboards/Commands/ShowLatestLogEntriesDashboardCommand.cs @@ -272,6 +272,19 @@ ClientOperations clientOps } } + // Ensure that the log entries are in descending order. + if (null != logEntries?.Entries) + logEntries.Entries.Sort + ( + (a, b) => + { + if (a.DateTime == null && b.DateTime == null) return 0; + if (a.DateTime == null) return 1; // null goes after non-null + if (b.DateTime == null) return -1; // null goes after non-null + return b.DateTime.Value.CompareTo(a.DateTime.Value); // reverse order + } + ); + // Create the directive. clientOps.Directives.Add(new VAF.Configuration.Domain.ClientDirective.UpdateDashboardContent() { diff --git a/MFiles.VAF.Extensions/Resources/DisplayLatestLogEntries.html b/MFiles.VAF.Extensions/Resources/DisplayLatestLogEntries.html index ce577c24..95d6e5bc 100644 --- a/MFiles.VAF.Extensions/Resources/DisplayLatestLogEntries.html +++ b/MFiles.VAF.Extensions/Resources/DisplayLatestLogEntries.html @@ -493,6 +493,13 @@
+
+ Note that in multi-server instances the log data may be spread amongst multiple files. + This viewer attempts to pull data from all server nodes into one location but there + are situations where data may not be in the correct order, especially in high-volume + deployments or high-verbosity configurations. + If in doubt, always download the log files and manually inspect what each node is doing. +
The logger is not using the default log layout, so structured formatting cannot be applied.