Click or drag to resize

AspNetLayoutRendererBaseRegister Method (String, FuncLogEventInfo, HttpContext, LoggingConfiguration, Object)

Note: This API is now obsolete.

Register a custom layout renderer with a callback function func. The callback receives the logEvent and the current configuration.

Namespace:  NLog.Web.LayoutRenderers
Assembly:  NLog.Web.AspNetCore (in NLog.Web.AspNetCore.dll) Version: 6.0.0+59339f2811712b446adf6dcd8a6bad39ad9f2ba1
Syntax
[ObsoleteAttribute("Instead use LogManager.Setup().SetupExtensions(). Marked obsolete with NLog v5.2")]
public static void Register(
	string name,
	Func<LogEventInfo, HttpContext?, LoggingConfiguration?, Object?> func
)

Parameters

name
Type: SystemString
Name of the layout renderer - without ${}.
func
Type: SystemFuncLogEventInfo, HttpContext, LoggingConfiguration, Object
Callback that returns the value for the layout renderer.
See Also