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

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

            if ((historyTarget == null) && !IsUsingCustomConfiguration)
            {
                historyTarget = new HistoryTarget("History")
                {
                    Layout   = GeneralLayout,
                    MaxCount = 20
                };

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

                LogManager.ReconfigExistingLoggers();
            }

            ArchiKestrel.OnNewHistoryTarget(historyTarget);
        }
Exemple #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();

            ArchiKestrel.OnNewHistoryTarget(historyTarget);
        }