Exemplo n.º 1
0
        private async Task ClearAsync()
        {
            var logContext = (actionId : Guid.NewGuid().ToString(), consumer : eventConsumer.Name);

            log.LogInformation(logContext, (ctx, w) => w
                               .WriteProperty("action", "EventConsumerReset")
                               .WriteProperty("actionId", ctx.actionId)
                               .WriteProperty("status", "Started")
                               .WriteProperty("eventConsumer", ctx.consumer));

            using (log.MeasureTrace(logContext, (ctx, w) => w
                                    .WriteProperty("action", "EventConsumerReset")
                                    .WriteProperty("actionId", ctx.actionId)
                                    .WriteProperty("status", "Completed")
                                    .WriteProperty("eventConsumer", ctx.consumer)))
            {
                await eventConsumer.ClearAsync();
            }
        }
Exemplo n.º 2
0
        private async Task ClearAsync()
        {
            var actionId = Guid.NewGuid().ToString();

            log.LogInformation(w => w
                               .WriteProperty("action", "EventConsumerReset")
                               .WriteProperty("actionId", actionId)
                               .WriteProperty("state", "Started")
                               .WriteProperty("eventConsumer", eventConsumer.Name));

            using (log.MeasureTrace(w => w
                                    .WriteProperty("action", "EventConsumerReset")
                                    .WriteProperty("actionId", actionId)
                                    .WriteProperty("state", "Completed")
                                    .WriteProperty("eventConsumer", eventConsumer.Name)))
            {
                await eventConsumer.ClearAsync();
            }
        }