HttpClientLogging.Initialize Method |
Instruments the PostSharp.Patterns.Diagnostics.Adapters.HttpClient class.
Namespace: PostSharp.Patterns.Diagnostics.Adapters.HttpClient
Assembly: PostSharp.Patterns.Diagnostics.Adapters.HttpClient (in PostSharp.Patterns.Diagnostics.Adapters.HttpClient.dll) Version: 6.9.11.0 (6.9.11.0)
C#
public static IDisposable Initialize( ICorrelationProtocol correlationProtocol = null, Predicate<Uri> requestUriPredicate = null )
Parameters
- correlationProtocol (Optional)
- Type: PostSharp.Patterns.Diagnostics.Correlation.ICorrelationProtocol
An optional implementation of ICorrelationProtocol to support distributed logging and add relevant headers to outgoing requests. - requestUriPredicate (Optional)
- Type: System.Predicate<Uri>
A predicate that determines whether a given outgoing request should be captured. If null, all requests are captured.
Return Value
Type: IDisposableAn opaque token to dispose when instrumentation is no longer needed.
It's the user's responsibility to call this method only once.