ekmsystems / serilog-enrichers-correlation-id

Enrich logs with a unique ID so you can track logs for specific requests.
MIT License
93 stars 38 forks source link

Modification original code to support any header #90

Closed Freysi21 closed 2 years ago

Freysi21 commented 2 years ago

I modified the original Enricher to support logging of any header rather then just x-correlation-id. The first parameter is the header name in http request. The second the name of the property to create in log and last is a boolean to decide if a value should be created if not provided in http headers.

.Enrich.CreateOrIncludeWithHeader("X-Correlation-ID", "CorrelationId", true) .Enrich.CreateOrIncludeWithHeader("X-Session-ID", "SessionId", false) .Enrich.CreateOrIncludeWithHeader("X-User-ID", "UserId", false)

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Freysi21 commented 1 year ago

Heeey, first ever pull request I thought made sense. Why is it gone stale? I've used this in production and its been a life saver for my logs. Just curious about my baby contribution. Thank you for these enrichers. They are great :) @mrstebo @lkurzyniec @ejcoyle88 @jackcaldwell

ejcoyle88 commented 1 year ago

Hi, please see #96 for why your MR went stale.