Пример #1
0
 public LogEventMsgSet(AsyncLogEventInfo asyncLogEvent, ByteArray buffer, MessageBuilder messageBuilder, MessageTransmitter messageTransmitter)
 {
     this.asyncLogEvent = asyncLogEvent;
     this.buffer = buffer;
     this.messageBuilder = messageBuilder;
     this.messageTransmitter = messageTransmitter;
     currentMessage = 0;
 }
Пример #2
0
 public AsyncLogger(Layout loggingLayout, EnforcementConfig enforcementConfig, MessageBuilder messageBuilder, MessageTransmitterConfig messageTransmitterConfig)
 {
     layout = loggingLayout;
     cts = new CancellationTokenSource();
     token = cts.Token;
     throttling = Throttling.FromConfig(enforcementConfig.Throttling);
     queue = NewBlockingCollection();
     buffer = new ByteArray(enforcementConfig.TruncateMessageTo);
     messageTransmitter = MessageTransmitter.FromConfig(messageTransmitterConfig);
     Task.Factory.StartNew(() => ProcessQueueAsync(messageBuilder));
 }