/// <summary> /// Register a custom layout renderer with a callback function <paramref name="layoutRenderer"/>. The callback receives the logEvent and the current configuration. /// </summary> /// <param name="layoutRenderer">Renderer with callback func</param> public static void Register(FuncLayoutRenderer layoutRenderer) { ConfigurationItemFactory.Default.GetLayoutRenderers().RegisterFuncLayout(layoutRenderer.LayoutRendererName, layoutRenderer); }
/// <summary> /// Register a custom layout renderer with a callback function <paramref name="func"/>. The callback recieves the logEvent and the current configuration. /// </summary> /// <param name="name">Name of the layout renderer - without ${}.</param> /// <param name="func">Callback that returns the value for the layout renderer.</param> public static void Register(string name, Func <LogEventInfo, LoggingConfiguration, object> func) { var layoutRenderer = new FuncLayoutRenderer(name, func); ConfigurationItemFactory.Default.GetLayoutRenderers().RegisterFuncLayout(name, layoutRenderer); }
/// <summary> /// Register a custom layout renderer with a callback function <paramref name="func"/>. The callback receives the logEvent and the current configuration. /// </summary> /// <param name="name">Name of the layout renderer - without ${}.</param> /// <param name="func">Callback that returns the value for the layout renderer.</param> public static void Register(string name, Func <LogEventInfo, LoggingConfiguration, object> func) { var layoutRenderer = new FuncLayoutRenderer(name, func); Register(layoutRenderer); }