stevejgordon / CorrelationId

An ASP.NET Core middleware component which synchronises a correlation ID for cross API request logging.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow custom correlation id generation

jesuslpm opened this issue · comments

I think it would be useful to be able to use a custom correlation id generator. Please, add the following property to CorrelationIdOptions :

/// <summary>
/// A function that returns the correlation id. It can be used to customize the correlation id generation.
/// For example, it can return sequential guids such as the one provided by https://github.com/richardtallent/RT.Comb
/// options.CorrelationIdGenerator = () => RT.Comb.Provider.PostgreSql.Create().ToString("N");
/// </summary>
public Func<string> CorrelationIdGenerator { get; set; }

Created pull request: #40

This has been merged