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(); }
public GelfLogger(string name, GelfMessageProcessor messageProcessor, GelfLoggerOptions options) { _name = name; _messageProcessor = messageProcessor; _options = options; }