public static void Register(this ExceptionlessClient client)
        {
            client.Startup();

            // make sure that queued events are sent when the app exits
            client.RegisterOnProcessExitHandler();
        }
        public static IApplicationBuilder UseExceptionless(this IApplicationBuilder app, ExceptionlessClient client = null)
        {
            if (client == null)
            {
                client = app.ApplicationServices.GetService <ExceptionlessClient>() ?? ExceptionlessClient.Default;
            }

            // Can be registered in Startup.ConfigureServices via services.AddHttpContextAccessor();
            // this is necessary to obtain Session and Request information outside of ExceptionlessMiddleware
            var contextAccessor = app.ApplicationServices.GetService <IHttpContextAccessor>();

            client.Startup();
            client.Configuration.AddPlugin(new ExceptionlessAspNetCorePlugin(contextAccessor));
            client.Configuration.AddPlugin <IgnoreUserAgentPlugin>();
            //client.Configuration.Resolver.Register<ILastReferenceIdManager, WebLastReferenceIdManager>();

            var diagnosticListener = app.ApplicationServices.GetRequiredService <DiagnosticListener>();

            diagnosticListener?.SubscribeWithAdapter(new ExceptionlessDiagnosticListener(client));

            var lifetime = app.ApplicationServices.GetRequiredService <IApplicationLifetime>();

            lifetime.ApplicationStopping.Register(() => client.ProcessQueue());

            return(app.UseMiddleware <ExceptionlessMiddleware>(client));
        }
Пример #3
0
        public static void RegisterWebApi(this ExceptionlessClient client, HttpConfiguration config)
        {
            client.RegisterPlugin(new ExceptionlessWebApiPlugin());
            client.Startup();
            client.Configuration.IncludePrivateInformation = true;

            ReplaceHttpErrorHandler(config);
        }
        public static void RegisterWebApi(this ExceptionlessClient client, HttpConfiguration config)
        {
            client.Startup();
            client.Configuration.AddEnrichment <ExceptionlessWebApiEnrichment>();
            client.Configuration.IncludePrivateInformation = true;

            ReplaceHttpErrorHandler(config);
        }
Пример #5
0
        public static void Register(this ExceptionlessClient client)
        {
            client.Startup();

            // make sure that queued events are sent when the app exits
            AppDomain.CurrentDomain.ProcessExit += (sender, args) => {
                client.ProcessQueue();
            };
        }
Пример #6
0
        /// <summary>
        /// Reads configuration settings, configures various plugins and wires up to platform specific exception handlers.
        /// </summary>
        /// <param name="client">The ExceptionlessClient.</param>
        /// <param name="pipelines">The IPipelines instance.</param>
        public static void RegisterNancy(this ExceptionlessClient client, IPipelines pipelines)
        {
            client.Startup();
            client.Configuration.IncludePrivateInformation = true;
            client.Configuration.AddPlugin <ExceptionlessNancyPlugin>();

            pipelines.OnError      += OnError;
            pipelines.AfterRequest += AfterRequest;
        }
Пример #7
0
        /// <summary>
        /// Reads configuration settings, configures various plugins and wires up to platform specific exception handlers.
        /// </summary>
        /// <param name="client">The ExceptionlessClient.</param>
        /// <param name="pipelines">The IPipelines instance.</param>
        public static void RegisterNancy(this ExceptionlessClient client, IPipelines pipelines)
        {
            client.Startup();
            client.Configuration.AddPlugin <ExceptionlessNancyPlugin>();
            client.Configuration.AddPlugin <IgnoreUserAgentPlugin>();

            pipelines.OnError      += OnError;
            pipelines.AfterRequest += AfterRequest;
        }
Пример #8
0
        /// <summary>
        /// Reads configuration settings, configures various plugins and wires up to platform specific exception handlers.
        /// </summary>
        /// <param name="client">The ExceptionlessClient.</param>
        /// <param name="config">The HttpConfiguration instance.</param>
        public static void RegisterWebApi(this ExceptionlessClient client, HttpConfiguration config)
        {
            client.Startup();
            client.Configuration.AddPlugin <ExceptionlessWebApiPlugin>();
            client.Configuration.AddPlugin <IgnoreUserAgentPlugin>();

            config.Services.Add(typeof(IExceptionLogger), new ExceptionlessExceptionLogger());

            ReplaceHttpErrorHandler(config, client);
        }
        /// <summary>
        /// Reads configuration settings, configures various plugins and wires up to platform specific exception handlers.
        /// </summary>
        /// <param name="client">The ExceptionlessClient.</param>
        public static void Register(this ExceptionlessClient client)
        {
            client.Startup();
            if (client.Configuration.SessionsEnabled)
            {
                client.SubmitSessionStart();
            }

            // make sure that queued events are sent when the app exits
            client.RegisterOnProcessExitHandler();
        }
Пример #10
0
        public static void RegisterWebApi(this ExceptionlessClient client, HttpConfiguration config)
        {
            client.Startup();
            client.Configuration.AddEnrichment <ExceptionlessWebApiEnrichment>();
            client.Configuration.IncludePrivateInformation = true;

#if WEBAPI21
            config.Services.Add(typeof(IExceptionLogger), new ExceptionlessExceptionLogger());
#endif

            ReplaceHttpErrorHandler(config);
        }
        public static void Register(this ExceptionlessClient client, bool showDialog = true)
        {
            client.Startup();
            client.RegisterApplicationThreadExceptionHandler();

            if (!showDialog)
            {
                return;
            }

            client.SubmittingEvent -= OnSubmittingEvent;
            client.SubmittingEvent += OnSubmittingEvent;
        }
        public static void Register(this ExceptionlessClient client, bool showDialog = true)
        {
            client.RegisterPlugin(new ExceptionlessWindowsPlugin(showDialog));
            client.Startup();

            if (showDialog)
            {
                client.UnhandledExceptionReporting -= UnhandledExceptionReporting;
                client.UnhandledExceptionReporting += UnhandledExceptionReporting;
            }

            Application.ThreadException -= OnApplicationThreadException;
            Application.ThreadException += OnApplicationThreadException;
        }
        /// <summary>
        /// Reads configuration settings, configures various plugins and wires up to platform specific exception handlers.
        /// </summary>
        /// <param name="client">The ExceptionlessClient.</param>
        /// <param name="pipelines">The IPipelines instance.</param>
        public static void RegisterNancy(this ExceptionlessClient client, IPipelines pipelines)
        {
            if (client == null)
            {
                throw new ArgumentNullException(nameof(client));
            }

            client.Startup();
            client.Configuration.AddPlugin <ExceptionlessNancyPlugin>();
            client.Configuration.AddPlugin <IgnoreUserAgentPlugin>();

            pipelines.OnError      += OnError;
            pipelines.AfterRequest += AfterRequest;
        }
Пример #14
0
        /// <summary>
        /// Reads configuration settings, configures various plugins and wires up to platform specific exception handlers.
        /// </summary>
        /// <param name="client">The ExceptionlessClient.</param>
        /// <param name="showDialog">Controls whether a dialog is shown when an unhandled exception occurs.</param>
        public static void Register(this ExceptionlessClient client, bool showDialog = true)
        {
            client.Startup();
            client.RegisterApplicationThreadExceptionHandler();

            // make sure that queued events are sent when the app exits
            client.RegisterOnProcessExitHandler();

            if (!showDialog)
            {
                return;
            }

            client.SubmittingEvent -= OnSubmittingEvent;
            client.SubmittingEvent += OnSubmittingEvent;
        }
        public static IApplicationBuilder UseExceptionless(this IApplicationBuilder app, ExceptionlessClient client = null) {
            if (client == null)
                client = ExceptionlessClient.Default;

            client.Startup();
            client.Configuration.AddPlugin<ExceptionlessAspNetCorePlugin>();
            client.Configuration.AddPlugin<IgnoreUserAgentPlugin>();
            //client.Configuration.Resolver.Register<ILastReferenceIdManager, WebLastReferenceIdManager>();
            
            var diagnosticListener = app.ApplicationServices.GetRequiredService<DiagnosticListener>();
            diagnosticListener?.SubscribeWithAdapter(new ExceptionlessDiagnosticListener(client));

            var lifetime = app.ApplicationServices.GetRequiredService<IApplicationLifetime>();
            lifetime.ApplicationStopping.Register(() => client.ProcessQueue());

            return app.UseMiddleware<ExceptionlessMiddleware>(client);
        }
        /// <summary>
        /// Reads configuration settings, configures various plugins and wires up to platform specific exception handlers.
        /// </summary>
        /// <param name="client">The ExceptionlessClient.</param>
        /// <param name="showDialog">Controls whether a dialog is shown when an unhandled exception occurs.</param>
        public static void Register(this ExceptionlessClient client, bool showDialog = true)
        {
            if (client == null)
            {
                throw new ArgumentNullException(nameof(client));
            }

            client.Configuration.AddPlugin <SetEnvironmentUserPlugin>();
            client.Startup();

            client.RegisterApplicationThreadExceptionHandler();

            if (!showDialog)
            {
                return;
            }

            client.SubmittingEvent -= OnSubmittingEvent;
            client.SubmittingEvent += OnSubmittingEvent;
        }
Пример #17
0
        public static void Register(this ExceptionlessClient client, bool showDialog = true)
        {
            if (client == null)
            {
                throw new ArgumentException("Exceptionless Manager cannot be null.", "client");
            }

            client.RegisterPlugin(new ExceptionlessWpfPlugin(showDialog));
            client.Startup();

            if (Application.Current == null)
            {
                return;
            }

            Application.Current.DispatcherUnhandledException -= OnDispatcherUnhandledException;
            Application.Current.DispatcherUnhandledException += OnDispatcherUnhandledException;

            System.Windows.Forms.Application.ThreadException -= OnApplicationThreadException;
            System.Windows.Forms.Application.ThreadException += OnApplicationThreadException;
        }
Пример #18
0
        public static IApplicationBuilder UseExceptionless(this IApplicationBuilder app, ExceptionlessClient client = null)
        {
            if (client == null)
            {
                client = ExceptionlessClient.Default;
            }

            client.Startup();
            client.Configuration.AddPlugin <ExceptionlessAspNetCorePlugin>();
            client.Configuration.AddPlugin <IgnoreUserAgentPlugin>();
            //client.Configuration.Resolver.Register<ILastReferenceIdManager, WebLastReferenceIdManager>();

            var diagnosticListener = app.ApplicationServices.GetRequiredService <DiagnosticListener>();

            diagnosticListener?.SubscribeWithAdapter(new ExceptionlessDiagnosticListener(client));

            var lifetime = app.ApplicationServices.GetRequiredService <IApplicationLifetime>();

            lifetime.ApplicationStopping.Register(() => client.ProcessQueue());

            return(app.UseMiddleware <ExceptionlessMiddleware>(client));
        }
Пример #19
0
        /// <summary>
        /// Reads configuration settings, configures various plugins and wires up to platform specific exception handlers.
        /// </summary>
        /// <param name="client">The ExceptionlessClient.</param>
        /// <param name="showDialog">Controls whether a dialog is shown when an unhandled exception occurs.</param>
        public static void Register(this ExceptionlessClient client, bool showDialog = true)
        {
            client.Configuration.AddPlugin <SetEnvironmentUserPlugin>();
            client.Startup();

            if (client.Configuration.SessionsEnabled)
            {
                client.SubmitSessionStart();
            }

            client.RegisterApplicationThreadExceptionHandler();

            // make sure that queued events are sent when the app exits
            client.RegisterOnProcessExitHandler();

            if (!showDialog)
            {
                return;
            }

            client.SubmittingEvent -= OnSubmittingEvent;
            client.SubmittingEvent += OnSubmittingEvent;
        }