Beispiel #1
0
        public static void ApplicationStart()
        {
            Started = DateTime.UtcNow;
            Urls    = new ApplicationUrls();

            InitializeLogging();
        }
Beispiel #2
0
        public static void ApplicationStart()
        {
            Started = DateTime.UtcNow;
            Urls    = new ApplicationUrls();

            try
            {
                if (Configuration.SendTelemetry &&
                    Telemetry.UseApplicationInsights &&
                    AppInsights == null)
                {
                    AppInsights = new TelemetryClient {
                        InstrumentationKey = Telemetry.Key
                    };
                    AppInsights.Context.Session.Id        = Guid.NewGuid().ToString();
                    AppInsights.Context.Component.Version = GetVersion();

                    AppRunTelemetry =
                        AppInsights.StartOperation <RequestTelemetry>(
                            $"App Run - {GetVersion()} - {Configuration.ApplicationUpdates.AccessCount + 1} - {(UnlockKey.IsRegistered() ? "registered" : "unregistered")}");
                    AppRunTelemetry.Telemetry.Start();
                }
            }
            catch (Exception ex)
            {
                Telemetry.UseApplicationInsights = false;
                LogToLogfile("Application Insights initialization failure: " + ex.GetBaseException().Message);
            }
        }