| LayoutTFromMethod Method |
Create a typed layout from a lambda method.
Namespace:
NLog.Layouts
Assembly:
NLog (in NLog.dll) Version: 5.3.4+73d83d3161d31288ca5c554cc50d27b6bed5f28b
Syntax public static Layout<T> FromMethod(
Func<LogEventInfo, T> layoutMethod,
LayoutRenderOptions options = LayoutRenderOptions.None
)
Public Shared Function FromMethod (
layoutMethod As Func(Of LogEventInfo, T),
Optional options As LayoutRenderOptions = LayoutRenderOptions.None
) As Layout(Of T)
Dim layoutMethod As Func(Of LogEventInfo, T)
Dim options As LayoutRenderOptions
Dim returnValue As Layout(Of T)
returnValue = Layout.FromMethod(layoutMethod,
options)
static member FromMethod :
layoutMethod : Func<LogEventInfo, 'T> *
?options : LayoutRenderOptions
(* Defaults:
let _options = defaultArg options LayoutRenderOptions.None
*)
-> Layout<'T>
Parameters
- layoutMethod
- Type: SystemFuncLogEventInfo, T
Method that renders the layout. - options (Optional)
- Type: NLog.LayoutsLayoutRenderOptions
Whether method is ThreadAgnostic and doesn't depend on context of the logging application thread.
Return Value
Type:
LayoutTInstance of typed layout.
See Also