Example #1
0
        public YadlLoggerProvider(IYadlProcessor processor, YadlLoggerOptions options)
        {
            _options   = options;
            _processor = processor;

            if (_options == null)
            {
                throw new ArgumentNullException(nameof(_options));
            }

            if (_processor == null)
            {
                throw new ArgumentNullException(nameof(_processor));
            }

            if (_options.BatchSize <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(_options.BatchSize),
                                                      $"{nameof(_options.BatchSize)} must be a positive number.");
            }

            if (string.IsNullOrEmpty(_options.ConnectionString))
            {
                throw new ArgumentNullException(nameof(_options.ConnectionString),
                                                $"{nameof(_options.ConnectionString)} cannot be null or empty.");
            }

            if (string.IsNullOrEmpty(_options.TableDestination))
            {
                throw new ArgumentNullException(nameof(_options.TableDestination),
                                                $"{nameof(_options.TableDestination)} cannot be null or empty.");
            }
        }
Example #2
0
        public TimedHostedService(IYadlProcessor processor,
                                  YadlLoggerOptions options, ISqlServerBulk sqlServerBulk)
        {
            _processor     = processor;
            _options       = options;
            _sqlServerBulk = sqlServerBulk;

            _memberLock = new object();
        }
Example #3
0
 public YadlLoggerProvider(IYadlProcessor processor, IOptions <YadlLoggerOptions> options) : this(processor,
                                                                                                  options.Value)
 {
 }
Example #4
0
 public YadlLogger(string name, YadlLoggerOptions options, IYadlProcessor processor)
 {
     _name      = name;
     _options   = options;
     _processor = processor;
 }
Example #5
0
 public YadlLogger(string name, IOptions <YadlLoggerOptions> options, IYadlProcessor processor) : this(name,
                                                                                                       options.Value,
                                                                                                       processor)
 {
 }
Example #6
0
 public TimedHostedService(IYadlProcessor processor,
                           IOptions <YadlLoggerOptions> options, ISqlServerBulk sqlServerBulk) : this(processor, options.Value,
                                                                                                      sqlServerBulk)
 {
 }