Class HttpRequestNumberEnricher
Enrich log events with a HttpRequestNumber unique within the current logging session. Original source - https://github.com/serilog-web/classic/blob/master/src/SerilogWeb.Classic/Classic/Enrichers/HttpRequestNumberEnricher.cs Nupkg: 'Serilog.Web.Classic' contains handlers and extra bits we do not want
Inheritance
object
Namespace: Umbraco.Cms.Core.Logging.Serilog.Enrichers
Assembly: Umbraco.Infrastructure.dll
Syntax
public class HttpRequestNumberEnricher : ILogEventEnricher
Constructors
View SourceHttpRequestNumberEnricher(IRequestCache)
Initializes a new instance of the HttpRequestNumberEnricher class, which enriches log events with a unique request number for each HTTP request.
Declaration
public HttpRequestNumberEnricher(IRequestCache requestCache)
Parameters
| Type | Name | Description |
|---|---|---|
| IRequestCache | requestCache | The IRequestCache instance used to store and retrieve the unique request number for the current HTTP request. |
Methods
View SourceEnrich(LogEvent, ILogEventPropertyFactory)
Enrich the log event with the number assigned to the currently-executing HTTP request, if any.
Declaration
public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| LogEvent | logEvent | The log event to enrich. |
| ILogEventPropertyFactory | propertyFactory | Factory for creating new properties to add to the event. |