コード例 #1
0
        public BlobOutput(BaseLogger logger, string connectionString, string containerName)
        {
            _logger = logger;

            _batchSize      = 10000;
            _flushDuration  = TimeSpan.FromMilliseconds(5);
            _lastUploadTime = DateTime.UtcNow;
            _nextBatch      = new List <IDictionary <string, object> >();

            Completed = new AutoResetEvent(false);

            if (!string.IsNullOrEmpty(connectionString) && !string.IsNullOrEmpty(containerName))
            {
                _blobServiceClient   = new BlobServiceClient(connectionString);
                _blobContainerClient = _blobServiceClient.GetBlobContainerClient(containerName);
                _blobContainerClient.CreateIfNotExists();
            }
            else
            {
                _logger.Log(LogLevel.ERROR, $"ERROR setting up connection to Blob. Please double check the information provided.");
                _error = true;
            }
        }
コード例 #2
0
 public ConsoleJsonOutput(BaseLogger logger)
 {
     _running = true;
     _logger  = logger;
 }