Files
desktop-edge-win/DesktopEdge/Utils/UIUtils.cs
T
dovholuknf ee26b64c97 fix issue with UI log not writing debug/trace logs when debugging
fix issue with enrolling an identity and the identity shows disabled
initially
add posture checks to the data model so the UI can render them
various cleanups
2021-03-23 23:12:54 -04:00

28 lines
765 B
C#

using System;
using System.Threading.Tasks;
using NLog;
namespace Ziti.Desktop.Edge.Utils {
public class UIUtils {
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
public static void SetLogLevel(string level) {
try {
Logger.Info("request to change log level received: {0}", level);
var l = LogLevel.FromString(level);
foreach (var rule in LogManager.Configuration.LoggingRules) {
rule.EnableLoggingForLevel(l);
rule.SetLoggingLevels(l, LogLevel.Error);
}
LogManager.ReconfigExistingLoggers();
Logger.Info("logger reconfigured to log at level: {0}", l);
} catch (Exception e) {
Logger.Error(e, "Failed to set log level: {0}", e.Message);
}
}
}
}