Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
 public void AddChannel(IEventChannel channel, CancellationToken token)
 {
     lock (_syncRoot)
     {
         _channels.Add(channel);
         foreach (var message in _replayBuffer)
         {
             channel.Send(message, token);
         }
     }
 }
Exemplo n.º 4
0
 public void AddChannel(IEventChannel channel, CancellationToken token)
 {
     lock (_syncRoot)
     {
         _channels.Add(channel);
         foreach (var message in _replayBuffer)
         {
             channel.Send(message, token);
         }
     }
 }