Example #1
0
        internal static void InitHistoryLogger()
        {
            if (LogManager.Configuration == null)
            {
                return;
            }

            HistoryTarget historyTarget = LogManager.Configuration.AllTargets.OfType <HistoryTarget>().FirstOrDefault();

            if ((historyTarget == null) && !IsUsingCustomConfiguration)
            {
                // TODO: We could use some nice HTML layout for this
                historyTarget = new HistoryTarget("History")
                {
                    Layout   = GeneralLayout,
                    MaxCount = 20
                };

                LogManager.Configuration.AddTarget(historyTarget);
                LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Debug, historyTarget));

                LogManager.ReconfigExistingLoggers();
            }

            IPC.OnNewHistoryTarget(historyTarget);
        }
Example #2
0
        private static void OnConfigurationChanged(object sender, LoggingConfigurationChangedEventArgs e)
        {
            if ((sender == null) || (e == null))
            {
                ASF.ArchiLogger.LogNullError(nameof(sender) + " || " + nameof(e));
                return;
            }

            InitConsoleLoggers();

            if (IsWaitingForUserInput)
            {
                OnUserInputStart();
            }

            HistoryTarget historyTarget = LogManager.Configuration.AllTargets.OfType <HistoryTarget>().FirstOrDefault();

            IPC.OnNewHistoryTarget(historyTarget);
        }
Example #3
0
        internal static void InitHistoryLogger()
        {
            if (IsUsingCustomConfiguration || (LogManager.Configuration == null))
            {
                return;
            }

            // TODO: We could use some nice HTML layout for this
            HistoryTarget historyTarget = new HistoryTarget("History")
            {
                Layout   = GeneralLayout,
                MaxCount = 20
            };

            LogManager.Configuration.AddTarget(historyTarget);
            LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Debug, historyTarget));

            LogManager.ReconfigExistingLoggers();
            IPC.OnNewHistoryTarget(historyTarget);
        }