King.Service
King.Service copied to clipboard
LoggingProcessor
namespace King.Service.ServiceBus.Demo.Processors
{
using System;
using System.Diagnostics;
using System.Threading.Tasks;
public class LoggingProcessor : IBusEventHandler<object>
{
public Task<bool> Process(object data)
{
Trace.TraceInformation("{0}", data);
return Task.FromResult<bool>(true);
}
public Task OnError(string action, Exception ex)
{
Trace.TraceError("Errored on {0}: {1}", action, ex.Message);
return Task.FromResult<bool>(true);
}
}
}