Click or drag to resize

AspNetLayoutRendererBaseRegister Method (String, FuncLogEventInfo, HttpContextBase, 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 (in NLog.Web.dll) Version: 6.2.1+0fbab61663063d0bae72649f7924db954f8bf1b6
Syntax
[ObsoleteAttribute("Instead use LogManager.Setup().SetupExtensions(). Marked obsolete with NLog v5.2")]
public static void Register(
	string name,
	Func<LogEventInfo, HttpContextBase?, LoggingConfiguration?, Object?> func
)

Parameters

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