stevejgordon / CorrelationId

An ASP.NET Core middleware component which synchronises a correlation ID for cross API request logging.
MIT License
558 stars 106 forks source link

Exclude endpoints feature #109

Closed dmytrohridin closed 1 year ago

dmytrohridin commented 2 years ago

Hi, What about separate setting option that will allow to specify API endpoints for which correlation id will be ignored and will not generate? Use case: In my API I use HTTP logging, and I want health check endpoints do not generate CorrelationId. For sure it can be filtered on logging level before sending logs to the datastore, but what about such a feature for this library? It should not affect backward compatibility. If my idea makes sense - I can implement this one.

dmytrohridin commented 2 years ago

Another use case: Turn on enforce header, health endpoints will fail. Any idea for a workaround?