Ejemplo n.º 1
0
 public GelfMessageProcessor(IGelfClient gelfClient)
 {
     _gelfClient    = gelfClient;
     _messageBuffer = new BufferBlock <GelfMessage>(new DataflowBlockOptions
     {
         BoundedCapacity = 10000
     });
 }
Ejemplo n.º 2
0
        public GelfLoggerProvider(GelfLoggerOptions options)
        {
            if (string.IsNullOrEmpty(options.Host))
            {
                throw new ArgumentException("GELF host is required.", nameof(options));
            }

            if (string.IsNullOrEmpty(options.LogSource))
            {
                throw new ArgumentException("GELF log source is required.", nameof(options));
            }

            _options          = options;
            _gelfClient       = CreateGelfClient(_options);
            _messageProcessor = new GelfMessageProcessor(_gelfClient);
            _messageProcessor.Start();
        }