---
title: "Class LoggingComponentRenderer"
slug: "sitecore.aspnet.renderingengine.rendering.loggingcomponentrenderer"
abstract: ""
---
# Class LoggingComponentRenderer

An [IComponentRenderer](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.icomponentrenderer.html) that writes to a specified log instead of generating HTML output.

## Inheritance

System.Object

LoggingComponentRenderer

### Implements

[IComponentRenderer](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.icomponentrenderer.html)

#### **Namespace**: Sitecore.AspNet.RenderingEngine.Rendering

##### **Assembly**: Sitecore.AspNet.RenderingEngine.dll

##### Syntax

```csharp
public class LoggingComponentRenderer : Object, IComponentRenderer

```

### Constructors

#### LoggingComponentRenderer(ILogger<LoggingComponentRenderer>)

Initializes a new instance of the [LoggingComponentRenderer](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.loggingcomponentrenderer.html) class.

##### Declaration

```csharp
public LoggingComponentRenderer(ILogger<LoggingComponentRenderer> logger)

```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| Microsoft.Extensions.Logging.ILogger<br><br><<br><br>LoggingComponentRenderer<br><br>> | logger | The Microsoft.Extensions.Logging.ILogger to use for logging. |

### Methods

#### Describe(Predicate<String>)

Creates an instance of a [ComponentRendererDescriptor](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.componentrendererdescriptor.html) for the [LoggingComponentRenderer](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.loggingcomponentrenderer.html) class.

##### Declaration

```csharp
public static ComponentRendererDescriptor Describe(Predicate<string> match)

```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.Predicate<br><br><<br><br>System.String<br><br>> | match | A predicate to use when attempting to match a layout component. |

##### Returns

| Type | Description |
| --- | --- |
| ComponentRendererDescriptor | An instance of [ComponentRendererDescriptor](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.componentrendererdescriptor.html) that describes the [LoggingComponentRenderer](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.loggingcomponentrenderer.html). |

#### Render(ISitecoreRenderingContext, ViewContext)

Generates the output HTML.

##### Declaration

```csharp
public Task<IHtmlContent> Render(ISitecoreRenderingContext renderingContext, ViewContext viewContext)

```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| ISitecoreRenderingContext | renderingContext | The current [ISitecoreRenderingContext](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.isitecorerenderingcontext.html). |
| Microsoft.AspNetCore.Mvc.Rendering.ViewContext | viewContext | The current Microsoft.AspNetCore.Mvc.Rendering.ViewContext. |

##### Returns

| Type | Description |
| --- | --- |
| System.Threading.Tasks.Task<br><br><<br><br>Microsoft.AspNetCore.Html.IHtmlContent<br><br>> | The HTML content to render. |

### Implements

[IComponentRenderer](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.icomponentrenderer.html)
