PostSharp 6.9 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Diagnostics.​Adapters.​Http­Client Namespace / Http­Client­Logging Class / Http­Client­Logging Methods / Http­Client­Logging.​Initialize Method

HttpClientLogging.Initialize Method

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)
Syntax
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: IDisposable
An opaque token to dispose when instrumentation is no longer needed.
Remarks

It's the user's responsibility to call this method only once.

See Also