public virtual async Task EmitErrorEventAsync(ErrorIntegrationEvent @event) { _logger.LogError($"{nameof(IEventManager)} emitted Error event of {@event.DynamicEventName} at {@event.CreationDate}"); foreach (var eventPersister in _eventPersisters) { await eventPersister.PersistErrorEventAsync(@event); } }
public Task PersistErrorEventAsync(ErrorIntegrationEvent @event) { _telemetryClient.TrackEvent(@event.DynamicEventName, new Dictionary <string, string>() { { "Id", @event.Id.ToString() }, { "CorrelationId", @event.CorrelationId?.ToString() }, { "CreatationDate", @event.CreationDate.ToString() }, { "IntegrationName", @event.IntegrationName?.ToString() }, { "Status", @event.IntegrationStatus }, { "Type", @event.Type.ToString() }, { "Payload", @event.Payload } } ); return(Task.CompletedTask); }