Click or drag to resize

AspNetRequestUrlRenderer Class

ASP.NET Request URL
Inheritance Hierarchy
SystemObject
  NLog.LayoutRenderersLayoutRenderer
    NLog.Web.LayoutRenderersAspNetLayoutRendererBase
      NLog.Web.LayoutRenderersAspNetRequestUrlRenderer

Namespace:  NLog.Web.LayoutRenderers
Assemblies:   NLog.Web.AspNetCore (in NLog.Web.AspNetCore.dll) Version: 5.3.13+628b0876960af3ee3454c99b7985dbb5e1c46bf0
  NLog.Web (in NLog.Web.dll) Version: 5.3.13+628b0876960af3ee3454c99b7985dbb5e1c46bf0
Syntax
public class AspNetRequestUrlRenderer : AspNetLayoutRendererBase

The AspNetRequestUrlRenderer type exposes the following members.

Constructors
  NameDescription
Public methodAspNetRequestUrlRenderer
Initializes a new instance of the AspNetRequestUrlRenderer class
Top
Properties
  NameDescription
Public propertyHttpContextAccessor
Provides access to the current request HttpContext.
(Inherited from AspNetLayoutRendererBase.)
Public propertyIncludeHost Obsolete.
To specify whether to exclude / include the host. Default is true.
Public propertyIncludePath Obsolete.
To specify whether to exclude / include the url-path. Default is true.
Public propertyIncludePort Obsolete.
To specify whether to include / exclude the Port. Default is false.
Public propertyIncludeQueryString Obsolete.
To specify whether to include / exclude the Query string. Default is false.
Public propertyIncludeScheme Obsolete.
To specify whether to exclude / include the scheme. Ex. 'http' or 'https'. Default is true.
Protected propertyLoggingConfiguration
Gets the logging configuration this target is part of.
(Inherited from LayoutRenderer.)
Public propertyProperties
A flags enumeration that controls which of the five portions of the URL are logged. Defaults to scheme://host/path, port and query string are by default not logged.
Public propertyUseRawTarget
To specify whether to use raw path and full query. Default is false. See https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.features.ihttprequestfeature.rawtarget
Protected propertyValueFormatter
Value formatter
(Inherited from LayoutRenderer.)
Top
Methods
  NameDescription
Protected methodAppend
Validates that the HttpContext is available and delegates append to subclasses.StringBuilder.
(Inherited from AspNetLayoutRendererBase.)
Protected methodCloseLayoutRenderer
Closes the layout renderer.
(Inherited from AspNetLayoutRendererBase.)
Protected methodDoAppend
Renders the value of layout renderer in the context of the specified log event into StringBuilder.
(Overrides AspNetLayoutRendererBaseDoAppend(StringBuilder, LogEventInfo).)
Protected methodGetCulture
Get the CultureInfo for rendering the messages to a String
(Inherited from LayoutRenderer.)
Protected methodGetFormatProvider
Get the IFormatProvider for rendering the messages to a String
(Inherited from LayoutRenderer.)
Protected methodInitializeLayoutRenderer
Initializes the layout renderer.
(Inherited from LayoutRenderer.)
Public methodRender
Renders the value of layout renderer in the context of the specified log event.
(Inherited from LayoutRenderer.)
Protected methodResolveServiceT
Resolves the interface service-type from the service-repository
(Inherited from LayoutRenderer.)
Public methodToString
Returns a string that represents the current object.
(Inherited from LayoutRenderer.)
Top
Remarks
1${aspnet-request-url:IncludeQueryString=true} - produces http://www.example.com/?t=1
2${aspnet-request-url:IncludeQueryString=false} - produces http://www.example.com/
3${aspnet-request-url:IncludePort=true} - produces http://www.example.com:80/
4${aspnet-request-url:IncludePort=false} - produces http://www.example.com/
5${aspnet-request-url:IncludeScheme=false} - produces www.example.com/
6${aspnet-request-url:IncludePort=true:IncludeQueryString=true} - produces http://www.example.com:80/?t=1
See Also