Reputation: 451
Azure Event Hub Logging has a policy configuration which defines the information that gets logged downstream. I've set up an IEventProcessor listener which gets a handle to all of the EventData configured in the policy. I could write code in IEventProcessor to log this data through a company-specific logger. I could also write code in my IEventProcessor to skip additional logging if context.LastError.Reason = "OperationNotFound".
Is there a way to configure filters in the policy to handle this type of logic that would prefilter events that I want to log or don't want to log? Also, is there a way to programmatically do this through some type of pre-event handler? By the time my IEventProcessor listener implementation is reached, I'm assuming that the event has already been logged somewhere.
Upvotes: 0
Views: 120
Reputation: 142014
I would suggest using the choose policy and putting the <logtoeventhub>
policy inside the choose.
Upvotes: 1