Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoggingProcessor #47

Open
jefking opened this issue May 29, 2019 · 0 comments
Open

LoggingProcessor #47

jefking opened this issue May 29, 2019 · 0 comments

Comments

@jefking
Copy link
Owner

jefking commented May 29, 2019

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);
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant