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

Add user defined log properties to Azure Event Hub message properties #28

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

Puzjak
Copy link

@Puzjak Puzjak commented Nov 26, 2021

Enables users to define custom log properties to be sent on Azure Event Hub message as header using AzureEventHubLogContext class.
AzureEventHubLogContext.PushProperty method uses default LogContext 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 in AzureEventHubLogContext.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 😭

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

Successfully merging this pull request may close these issues.

1 participant