public ProcessingStatus Run()
        {
            Telemetry.TrackEvent("EngineStart",
                                 new Dictionary <string, string> {
                { "Engine", "Migration" }
            },
                                 new Dictionary <string, double> {
                { "Processors", Processors.Count },
                { "Mappings", FieldMaps.Count }
            });
            Stopwatch engineTimer = Stopwatch.StartNew();

            LoggingLevelSwitch logLevel = _services.GetRequiredService <LoggingLevelSwitch>();

            logLevel.MinimumLevel = Config.LogLevel;
            Log.Information("Logging has been configured and is set to: {LogLevel}. ", Config.LogLevel.ToString());
            Log.Information("                              Max Logfile: {FileLogLevel}. ", "Verbose");
            Log.Information("                              Max Console: {ConsoleLogLevel}. ", "Debug");
            Log.Information("                 Max Application Insights: {AILogLevel}. ", "Error");
            Log.Information("The Max log levels above show where to go look for extra info. e.g. Even if you set the log level to Verbose you will only see that info in the Log File, however everything up to Debug will be in the Console.");

            ProcessingStatus ps = ProcessingStatus.Running;

            Processors.EnsureConfigured();
            TypeDefinitionMaps.EnsureConfigured();
            GitRepoMaps.EnsureConfigured();
            ChangeSetMapps.EnsureConfigured();
            FieldMaps.EnsureConfigured();

            Log.Information("Beginning run of {ProcessorCount} processors", Processors.Count.ToString());
            foreach (_EngineV1.Containers.IProcessor process in Processors.Items)
            {
                Log.Information("Processor: {ProcessorName}", process.Name);
                Stopwatch processorTimer = Stopwatch.StartNew();
                process.Execute();
                processorTimer.Stop();
                Telemetry.TrackEvent("ProcessorComplete", new Dictionary <string, string> {
                    { "Processor", process.Name }, { "Status", process.Status.ToString() }
                }, new Dictionary <string, double> {
                    { "ProcessingTime", processorTimer.ElapsedMilliseconds }
                });

                if (process.Status == ProcessingStatus.Failed)
                {
                    ps = ProcessingStatus.Failed;
                    Log.Error("{Context} The Processor {ProcessorName} entered the failed state...stopping run", process.Name, "MigrationEngine");
                    break;
                }
            }
            engineTimer.Stop();
            Telemetry.TrackEvent("EngineComplete",
                                 new Dictionary <string, string> {
                { "Engine", "Migration" }
            },
                                 new Dictionary <string, double> {
                { "EngineTime", engineTimer.ElapsedMilliseconds }
            });
            return(ps);
        }
        public ProcessingStatus Run()
        {
            Telemetry.TrackEvent("EngineStart",
                                 new Dictionary <string, string> {
                { "Engine", "Migration" }
            },
                                 new Dictionary <string, double> {
                { "Processors", Processors.Count },
                { "Mappings", FieldMaps.Count }
            });
            Stopwatch engineTimer = Stopwatch.StartNew();

            ProcessingStatus ps = ProcessingStatus.Running;

            Processors.EnsureConfigured();
            TypeDefinitionMaps.EnsureConfigured();
            GitRepoMaps.EnsureConfigured();
            ChangeSetMapps.EnsureConfigured();
            FieldMaps.EnsureConfigured();

            Log.Information("Beginning run of {ProcessorCount} processors", Processors.Count.ToString());
            foreach (IProcessor process in Processors.Items)
            {
                Log.Information("Processor: {ProcessorName}", process.Name);
                Stopwatch processorTimer = Stopwatch.StartNew();
                process.Execute();
                processorTimer.Stop();
                Telemetry.TrackEvent("ProcessorComplete", new Dictionary <string, string> {
                    { "Processor", process.Name }, { "Status", process.Status.ToString() }
                }, new Dictionary <string, double> {
                    { "ProcessingTime", processorTimer.ElapsedMilliseconds }
                });

                if (process.Status == ProcessingStatus.Failed)
                {
                    ps = ProcessingStatus.Failed;
                    Log.Error("{Context} The Processor {ProcessorName} entered the failed state...stopping run", process.Name, "MigrationEngine");
                    break;
                }
            }
            engineTimer.Stop();
            Telemetry.TrackEvent("EngineComplete",
                                 new Dictionary <string, string> {
                { "Engine", "Migration" }
            },
                                 new Dictionary <string, double> {
                { "EngineTime", engineTimer.ElapsedMilliseconds }
            });
            return(ps);
        }