IAppBuilderExtensionsUseHttpLogger Method |
In order to capture the full set of data during a HTTP request this OWIN plugin must be the first plugin in the chain.
Configure OWIN to trace HTTP requests and responses. Note that capturing request query parameters and request and response data could cause
data security issues - potentially sensitive data will be logged to Azure table storage.
Therefore by default none of this is captured.
Namespace: AccidentalFish.ApplicationSupport.OwinAssembly: AccidentalFish.ApplicationSupport.Owin (in AccidentalFish.ApplicationSupport.Owin.dll) Version: 0.9.0.0 (0.9.0.0)
Syntaxpublic static IAppBuilder UseHttpLogger(
this IAppBuilder appBuilder,
IHttpLoggerRepository loggerRepository,
bool captureRequestParams = false,
bool captureRequestData = false,
bool captureResponseData = false,
string[] captureRequestHeaders = null,
string[] captureResponseHeaders = null,
string httpCorrelationHeaderKey = "correlation-id"
)
<ExtensionAttribute>
Public Shared Function UseHttpLogger (
appBuilder As IAppBuilder,
loggerRepository As IHttpLoggerRepository,
Optional captureRequestParams As Boolean = false,
Optional captureRequestData As Boolean = false,
Optional captureResponseData As Boolean = false,
Optional captureRequestHeaders As String() = Nothing,
Optional captureResponseHeaders As String() = Nothing,
Optional httpCorrelationHeaderKey As String = "correlation-id"
) As IAppBuilder
Parameters
- appBuilder
- Type: IAppBuilder
The OWIN app builder - loggerRepository
- Type: AccidentalFish.ApplicationSupport.OwinIHttpLoggerRepository
The repository to use for storing http logs - captureRequestParams (Optional)
- Type: SystemBoolean
True if you wish to capture query parameters, false if not. - captureRequestData (Optional)
- Type: SystemBoolean
True if you wish to capture request data, false if not. - captureResponseData (Optional)
- Type: SystemBoolean
True if you wish to capture response data, falise if not. - captureRequestHeaders (Optional)
- Type: SystemString
To capture all request headers set a single array element of "*" otherwise specify the headers you wish to capture. - captureResponseHeaders (Optional)
- Type: SystemString
To capture all response headers set a single array element of "*" otherwise specify the headers you wish to capture. - httpCorrelationHeaderKey (Optional)
- Type: SystemString
It can be helpful when calling across http boundaries to be able to tie together the flow of events with a correlation ID and by default the logger
looks for a correlation ID in the header correlation-id. If the header is missing then no correlation ID is used but the logger will work. If you
wish to disable this behaviour then set this to null or if you want to use a different header then set the header name here.
The HttpCorrelator middleware also in this assembly can be used to add a correlation ID if none is present and should be placed before the logger middleware
in the pipeline.
Return Value
Type:
IAppBuilder[Missing <returns> documentation for "M:AccidentalFish.ApplicationSupport.Owin.IAppBuilderExtensions.UseHttpLogger(Owin.IAppBuilder,AccidentalFish.ApplicationSupport.Owin.IHttpLoggerRepository,System.Boolean,System.Boolean,System.Boolean,System.String[],System.String[],System.String)"]
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IAppBuilder. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also