Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions Shared.EventStore/Extensions/IApplicationBuilderExtenstions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,17 @@ private static SubscriptionWorker ConfigureSubscriptionWorker(ISubscriptionRepos
_ => SubscriptionWorker.CreateSubscriptionWorker(eventStoreConnectionString, ehr.Value, subscriptionRepository, configurationSubscriptionWorker.InflightMessages, configuration.PersistentSubscriptionPollingInSeconds),
};

worker.Trace += (_,
args) => traceHandler(TraceEventType.Information, type, args.Message);
worker.Warning += (_,
args) => traceHandler(TraceEventType.Warning, type, args.Message);
worker.Error += (_,
args) => traceHandler(TraceEventType.Error, type, args.Message);
worker.ConfigureTracing(type, traceHandler);

worker.SetIgnoreGroups(configurationSubscriptionWorker.IgnoreGroups);
worker.SetIgnoreStreams(configurationSubscriptionWorker.IgnoreStreams);
worker.SetIncludeGroups(configurationSubscriptionWorker.IncludeGroups);
worker.SetIncludeStreams(configurationSubscriptionWorker.IncludeStreams);
return worker;
}



#endregion

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using global::EventStore.Client;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Net.Http;
Expand Down Expand Up @@ -171,5 +172,12 @@ public static SubscriptionWorker UseInMemory(this SubscriptionWorker subscriptio
return subscriptionWorker;
}

public static void ConfigureTracing(this SubscriptionWorker worker, string type, Action<TraceEventType, string, string> traceHandler)
{
worker.Trace += (_, args) => traceHandler(TraceEventType.Information, type, args.Message);
worker.Warning += (_, args) => traceHandler(TraceEventType.Warning, type, args.Message);
worker.Error += (_, args) => traceHandler(TraceEventType.Error, type, args.Message);
}

#endregion
}
Loading