<PackageReference Include="NLog" Version="6.1.3" />

NLog.LayoutRenderers.LayoutRenderer

Render environmental information related to logging events.

Gets the logging configuration this target is part of.

protected IValueFormatter ValueFormatter { get; }

Value formatter

protected LayoutRenderer()

public static void Register<T>(string name) where T : LayoutRenderer

Obsolete and replaced by Setup with NLog v5.2. Register a custom layout renderer.

public static void Register(string name, Type layoutRendererType)

Obsolete and replaced by Setup with NLog v5.2. Register a custom layout renderer.

public static void Register(string name, Func<LogEventInfo, object> func)

Obsolete and replaced by Setup with NLog v5.2. Register a custom layout renderer with a callback function func. The callback receives the logEvent.

public static void Register(string name, Func<LogEventInfo, LoggingConfiguration, object> func)

Obsolete and replaced by Setup with NLog v5.2. Register a custom layout renderer with a callback function func. The callback receives the logEvent and the current configuration.

public static void Register(FuncLayoutRenderer layoutRenderer)

Obsolete and replaced by Setup with NLog v5.2. Register a custom layout renderer with a callback function layoutRenderer. The callback receives the logEvent and the current configuration.

protected abstract void Append(StringBuilder builder, LogEventInfo logEvent)

Renders the value of layout renderer in the context of the specified log event into StringBuilder.

protected virtual void CloseLayoutRenderer()

Closes the layout renderer.

protected CultureInfo GetCulture(LogEventInfo logEvent, CultureInfo layoutCulture = null)

Get the CultureInfo for rendering the messages to a String

protected IFormatProvider GetFormatProvider(LogEventInfo logEvent, IFormatProvider layoutCulture = null)

Get the IFormatProvider for rendering the messages to a String

protected virtual void InitializeLayoutRenderer()

Initializes the layout renderer.

public string Render(LogEventInfo logEvent)

Renders the value of layout renderer in the context of the specified log event.

protected T ResolveService<T>()

Resolves the interface service-type from the service-repository