Beispiel #1
0
        public void Ship(LogzioLoggingEvent logzioLoggingEvent, ShipperOptions options)
        {
            _queue.Enqueue(logzioLoggingEvent);
            if (options.Debug)
            {
                _internalLogger.Log("Logz.io: Added log message. Queue size - [{0}]", _queue.Count);
            }

            SendLogsIfBufferIsFull(options);
            if (_delayTask == null || _delayTask.IsCompleted)
            {
                _delayTask = Task.Delay(options.BufferTimeLimit).ContinueWith(task => SendLogsIfBufferTimedOut(options));
            }
        }
Beispiel #2
0
        public void Ship(LogzioLoggingEvent logzioLoggingEvent, ShipperOptions options)
        {
            // ReSharper disable once InconsistentlySynchronizedField
            _queue.Enqueue(logzioLoggingEvent);
            if (options.Debug)
            {
                _internalLogger.Log("Added log message. Queue size - [{0}]", _queue.Count);
            }

            SendLogsIfBufferIsFull(options);
            if (_delayTask == null || _delayTask.IsCompleted)
            {
                _delayTask = Task.Delay(options.BufferTimeLimit).ContinueWith(task => SendLogsIfBufferTimedOut(options));
            }
        }