 | LayoutRendererRegister Method (String, FuncLogEventInfo, 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.LayoutRenderers
Assembly:
NLog (in NLog.dll) Version: 5.2.0+eed5f76d158dbcaef9326f7a0e1c281adad171e8
Syntax[ObsoleteAttribute("Instead use LogManager.Setup().SetupExtensions(). Marked obsolete with NLog v5.2")]
public static void Register(
string name,
Func<LogEventInfo, LoggingConfiguration, Object> func
)
<ObsoleteAttribute("Instead use LogManager.Setup().SetupExtensions(). Marked obsolete with NLog v5.2")>
Public Shared Sub Register (
name As String,
func As Func(Of LogEventInfo, LoggingConfiguration, Object)
)
Dim name As String
Dim func As Func(Of LogEventInfo, LoggingConfiguration, Object)
LayoutRenderer.Register(name, func)
[<ObsoleteAttribute("Instead use LogManager.Setup().SetupExtensions(). Marked obsolete with NLog v5.2")>]
static member Register :
name : string *
func : Func<LogEventInfo, LoggingConfiguration, Object> -> unit
Parameters
- name
- Type: SystemString
The layout-renderer type-alias for use in NLog configuration - without '${ }' - func
- Type: SystemFuncLogEventInfo, LoggingConfiguration, Object
Callback that returns the value for the layout renderer.
See Also