/// <summary> /// Submits the event to be sent to the server. /// </summary> /// <param name="ev">The event data.</param> /// <param name="pluginContextData"> /// Any contextual data objects to be used by Exceptionless plugins to gather default /// information for inclusion in the report information. /// </param> public void SubmitEvent(Event ev, ContextData pluginContextData = null) { if (ev == null) { throw new ArgumentNullException("ev"); } if (!Configuration.Enabled) { _log.Value.Info(typeof(ExceptionlessClient), "Configuration is disabled. The error will not be submitted."); return; } if (!Configuration.IsLocked) { Configuration.LockConfig(); if (!Configuration.IsValid) { _log.Value.FormattedError(typeof(ExceptionlessClient), "Disabling client due to invalid configuration: {0}", String.Join(", ", Configuration.Validate().Messages)); return; } } var context = new EventPluginContext(this, ev, pluginContextData); EventPluginManager.Run(context); if (context.Cancel) { return; } // ensure all required data if (String.IsNullOrEmpty(ev.Type)) { ev.Type = Event.KnownTypes.Log; } if (ev.Date == DateTimeOffset.MinValue) { ev.Date = DateTimeOffset.Now; } if (!OnSubmittingEvent(ev, pluginContextData)) { _log.Value.FormattedInfo(typeof(ExceptionlessClient), "Event submission cancelled by event handler: id={0} type={1}", ev.ReferenceId, ev.Type); return; } _log.Value.FormattedTrace(typeof(ExceptionlessClient), "Submitting event: type={0}{1}", ev.Type, !String.IsNullOrEmpty(ev.ReferenceId) ? " refid=" + ev.ReferenceId : String.Empty); _queue.Value.Enqueue(ev); if (String.IsNullOrEmpty(ev.ReferenceId)) { return; } _log.Value.FormattedTrace(typeof(ExceptionlessClient), "Setting last reference id '{0}'", ev.ReferenceId); _lastReferenceIdManager.Value.SetLast(ev.ReferenceId); }
public void CanCancel() { var client = new ExceptionlessClient(); foreach (var plugin in client.Configuration.Plugins) { client.Configuration.RemovePlugin(plugin.Key); } client.Configuration.AddPlugin("cancel", 1, ctx => ctx.Cancel = true); client.Configuration.AddPlugin("add-tag", 2, ctx => ctx.Event.Tags.Add("Was Not Canceled")); var context = new EventPluginContext(client, new Event()); EventPluginManager.Run(context); Assert.True(context.Cancel); Assert.Equal(0, context.Event.Tags.Count); }
public ExceptionlessConfiguration(IDependencyResolver resolver) { ServerUrl = DEFAULT_SERVER_URL; UserAgent = DEFAULT_USER_AGENT; SubmissionBatchSize = DEFAULT_SUBMISSION_BATCH_SIZE; Enabled = true; EnableSSL = true; DefaultTags = new TagSet(); DefaultData = new DataDictionary(); Settings = new SettingsDictionary(); if (resolver == null) { throw new ArgumentNullException("resolver"); } _resolver = resolver; EventPluginManager.AddDefaultPlugins(this); }
public ExceptionlessConfiguration(IDependencyResolver resolver) { if (resolver == null) { throw new ArgumentNullException("resolver"); } ServerUrl = DEFAULT_SERVER_URL; UserAgent = DEFAULT_USER_AGENT; SubmissionBatchSize = DEFAULT_SUBMISSION_BATCH_SIZE; Enabled = true; QueueMaxAge = TimeSpan.FromDays(7); QueueMaxAttempts = 3; DefaultTags = new TagSet(); DefaultData = new DataDictionary(); Settings = new SettingsDictionary(); IncludePrivateInformation = true; _resolver = resolver; EventPluginManager.AddDefaultPlugins(this); }
public void ShouldUseReferenceIds() { var client = new ExceptionlessClient(); foreach (var plugin in client.Configuration.Plugins) { client.Configuration.RemovePlugin(plugin.Key); } var context = new EventPluginContext(client, new Event { Type = Event.KnownTypes.Error }); EventPluginManager.Run(context); Assert.Null(context.Event.ReferenceId); client.Configuration.UseReferenceIds(); context = new EventPluginContext(client, new Event { Type = Event.KnownTypes.Error }); EventPluginManager.Run(context); Assert.NotNull(context.Event.ReferenceId); }
public RunEventProcessedPluginsAction(EventPluginManager pluginManager) { _pluginManager = pluginManager; }
public RunEventProcessingPluginsAction(EventPluginManager pluginManager) { _pluginManager = pluginManager; }
public RunEventProcessedPluginsAction(EventPluginManager pluginManager, ILoggerFactory loggerFactory = null) : base(loggerFactory) { _pluginManager = pluginManager; ContinueOnError = true; }
public RunEventProcessedPluginsAction(EventPluginManager pluginManager) { _pluginManager = pluginManager; ContinueOnError = true; }
public RunEventProcessingPluginsAction(EventPluginManager pluginManager, ILoggerFactory loggerFactory = null) : base(loggerFactory) { _pluginManager = pluginManager; ContinueOnError = true; }
public RunEventProcessingPluginsAction(EventPluginManager pluginManager, IOptions<AppOptions> options, ILoggerFactory loggerFactory = null) : base(options, loggerFactory) { _pluginManager = pluginManager; ContinueOnError = true; }
public RunEventProcessedPluginsAction(EventPluginManager pluginManager) { _pluginManager = pluginManager; ContinueOnError = true; }