Esempio n. 1
0
        private void InitBuffer(LoggerOptions options)
        {
            DebuggingLogger?.Debug("InitBuffer");

            messagesQueue = new BufferWithFifoEviction <string>(
                options.MaxQueueSizeBytes,
                new StringLengthCostAssigner(),
                DebuggingLogger);

            flushBufferTask = new SumoLogicMessageSenderBufferFlushingTask(
                messagesQueue,
                SumoLogicMessageSender,
                options.MaxFlushInterval,
                options.MessagesPerRequest,
                options.SourceName,
                options.SourceCategory,
                options.SourceHost,
                DebuggingLogger);

            flushBufferTimer = new Timer(
                callback: async _ => await flushBufferTask.Run(),
                state: null,
                dueTime: TimeSpan.FromMilliseconds(0),
                period: options.FlushingAccuracy);

            DebuggingLogger?.Debug("InitBuffer::Completed");
        }
Esempio n. 2
0
 private void InitSender(LoggerOptions options)
 {
     DebuggingLogger?.Debug("InitSender");
     SumoLogicMessageSender = new SumoLogicMessageSender(options.HttpMessageHandler, DebuggingLogger, "asp.net-core-logger")
     {
         Url = new Uri(options.Uri),
         ConnectionTimeout = options.ConnectionTimeout,
         RetryInterval     = options.RetryInterval
     };
     DebuggingLogger?.Debug("InitSender::Completed");
 }