protected override void Append(LoggingEvent loggingEvent) { var message = base.RenderLoggingEvent(loggingEvent); var sse = new ServerSentEvent(loggingEvent.Level.DisplayName, message); _channel.Send(sse, new CancellationTokenSource(TimeSpan.FromSeconds(5)).Token); }
protected override void Write(LogEventInfo logEvent) { if (Active) { var message = base.Layout.Render(logEvent); var sse = new ServerSentEvent(logEvent.Level.Name.ToUpperInvariant(), message); _channel.Send(sse, new CancellationTokenSource(TimeSpan.FromSeconds(5)).Token); } }
public void AddChannel(IEventChannel channel, CancellationToken token) { lock (_syncRoot) { _channels.Add(channel); foreach (var message in _replayBuffer) { channel.Send(message, token); } } }
public void AddChannel(IEventChannel channel, CancellationToken token) { lock (_syncRoot) { _channels.Add(channel); foreach (var message in _replayBuffer) { channel.Send(message, token); } } }