/// <summary> /// Reads configuration settings, configures various plugins and wires up to platform specific exception handlers. /// </summary> /// <param name="client">The ExceptionlessClient.</param> /// <param name="apiKey">The API key that will be used when sending events to the server.</param> public static void Startup(this ExceptionlessClient client, string apiKey = null) { if (client == null) { throw new ArgumentNullException(nameof(client)); } if (!String.IsNullOrEmpty(apiKey)) { client.Configuration.ApiKey = apiKey; } client.Configuration.ReadAllConfig(); client.Configuration.UseTraceLogEntriesPlugin(); if (client.Configuration.UpdateSettingsWhenIdleInterval == null) { client.Configuration.UpdateSettingsWhenIdleInterval = TimeSpan.FromMinutes(2); } client.RegisterAppDomainUnhandledExceptionHandler(); // make sure that queued events are sent when the app exits client.RegisterOnProcessExitHandler(); client.RegisterTaskSchedulerUnobservedTaskExceptionHandler(); if (client.Configuration.SessionsEnabled) { client.SubmitSessionStart(); } }
/// <summary> /// Reads configuration settings, configures various plugins and wires up to platform specific exception handlers. /// </summary> /// <param name="client">The ExceptionlessClient.</param> /// <param name="appDomain">The AppDomain to register the exception handlers on.</param> public static void Startup(this ExceptionlessClient client, AppDomain appDomain = null) { if (client.Configuration.Resolver.HasDefaultRegistration <ISubmissionClient, DefaultSubmissionClient>()) { client.Configuration.Resolver.Register <ISubmissionClient, SubmissionClient>(); } if (client.Configuration.Resolver.HasDefaultRegistration <IEnvironmentInfoCollector, DefaultEnvironmentInfoCollector>()) { client.Configuration.Resolver.Register <IEnvironmentInfoCollector, EnvironmentInfoCollector>(); } client.Configuration.ReadAllConfig(); client.Configuration.UseErrorPlugin(); client.Configuration.UseTraceLogEntriesPlugin(); client.Configuration.AddPlugin <VersionPlugin>(); if (client.Configuration.UpdateSettingsWhenIdleInterval == null) { client.Configuration.UpdateSettingsWhenIdleInterval = TimeSpan.FromMinutes(2); } client.RegisterAppDomainUnhandledExceptionHandler(appDomain); client.RegisterTaskSchedulerUnobservedTaskExceptionHandler(); }
public static void Startup(this ExceptionlessClient client, AppDomain appDomain = null) { client.Configuration.ReadAllConfig(); client.Configuration.UseErrorEnrichment(); client.Configuration.AddEnrichment <VersionEnrichment>(); client.Configuration.AddEnrichment <PrivateInformationEnrichment>(); client.Configuration.Resolver.Register <ISubmissionClient, SubmissionClient>(); client.Configuration.Resolver.Register <IEnvironmentInfoCollector, EnvironmentInfoCollector>(); client.RegisterAppDomainUnhandledExceptionHandler(appDomain); client.RegisterTaskSchedulerUnobservedTaskExceptionHandler(); }