Class LoggingComponentRenderer
Version: 21.x
An IComponentRenderer that writes to a specified log instead of generating HTML output.
Inheritance
System.Object
LoggingComponentRenderer
Implements
Namespace: Sitecore.AspNet.RenderingEngine.Rendering
Assembly: Sitecore.AspNet.RenderingEngine.dll
Syntax
Constructors
LoggingComponentRenderer(ILogger)
Initializes a new instance of the LoggingComponentRenderer class.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.Extensions.Logging.ILogger < LoggingComponentRenderer > | logger | The Microsoft.Extensions.Logging.ILogger to use for logging. |
Methods
Describe(Predicate)
Creates an instance of a ComponentRendererDescriptor for the LoggingComponentRenderer class.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Predicate < System.String > | match | A predicate to use when attempting to match a layout component. |
Returns
| Type | Description |
|---|---|
| ComponentRendererDescriptor | An instance of ComponentRendererDescriptor that describes the LoggingComponentRenderer. |
Render(ISitecoreRenderingContext, ViewContext)
Generates the output HTML.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| ISitecoreRenderingContext | renderingContext | The current ISitecoreRenderingContext. |
| Microsoft.AspNetCore.Mvc.Rendering.ViewContext | viewContext | The current Microsoft.AspNetCore.Mvc.Rendering.ViewContext. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task < Microsoft.AspNetCore.Html.IHtmlContent > | The HTML content to render. |
Implements
If you have suggestions for improving this article, let us know!