Add user defined log properties to Azure Event Hub message properties #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enables users to define custom log properties to be sent on Azure Event Hub message as header using
AzureEventHubLogContext
class.AzureEventHubLogContext.PushProperty
method uses defaultLogContext
to store log properties but adds a prefix on property key which is later filtered when determining properties to push on Event Hub message.Once properties with that prefix are fetched and parsed, prefix from the key is removed and those values are pushed to the message.
This pull request addresses enhancement #9 and last comment on pull request #18.
Initially I wanted to make this functionality more simple to take in only string as property type because that is the use case I need it for. Then I saw that a pull request addressing this issue already exists and I copied logic for parsing
LogEventPropertyValue
from that PR inAzureEventHubLogContext.GetEventPropertyValue
method.Honestly I would rather prefer it to be restricted to take in only string for the value because there is less room for error but I will let you decide that part 😄
I tried to edit the pull request directly but of course I got 403 response when I tried to push so that's why I'm making the separate one for the same issue 😭