/// <summary> /// Write log events to the specified <see cref="ILogEventSink"/>. /// </summary> /// <param name="logEventSink">The sink.</param> /// <param name="restrictedToMinimumLevel">The minimum level for /// events passed through the sink.</param> /// <returns>Configuration object allowing method chaining.</returns> public LoggerConfiguration Sink( ILogEventSink logEventSink, LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum) { var sink = logEventSink; if (restrictedToMinimumLevel > LevelAlias.Minimum) sink = new RestrictedSink(sink, restrictedToMinimumLevel); _addSink(sink); return _loggerConfiguration; }
/// <summary> /// Write log events to the specified <see cref="ILogEventSink"/>. /// </summary> /// <param name="logEventSink">The sink.</param> /// <param name="restrictedToMinimumLevel">The minimum level for /// events passed through the sink.</param> /// <returns>Configuration object allowing method chaining.</returns> public LoggerConfiguration WithSink(ILogEventSink logEventSink, LogEventLevel restrictedToMinimumLevel = LogEventLevel.Minimum) { var sink = logEventSink; if (restrictedToMinimumLevel > LogEventLevel.Minimum) sink = new RestrictedSink(sink, restrictedToMinimumLevel); _logEventSinks.Add(sink); return this; }