예제 #1
0
        public OutputHandlerBase Create(IServiceProvider serviceProvider, IConfigurationSection outputConfiguration)
        {
            var config = new InfluxDbOutputSettings();

            outputConfiguration.Bind(config);
            Validator.ValidateObject(config, new ValidationContext(config));

            return(ActivatorUtilities.CreateInstance <InfluxDbOutput>(serviceProvider, config));
        }
예제 #2
0
        public InfluxDbOutput(InfluxDbOutputSettings settings, ILogger <InfluxDbOutput> logger)
        {
            _settings = settings;
            _logger   = logger;

            _pointFactory = _settings.Format switch
            {
                InfluxDbOutputSettings.InfluxFormat.Arguments => new ArgumentPointFactory(),
                InfluxDbOutputSettings.InfluxFormat.Syslog => new SyslogPointFactory(_settings),
                _ => throw new ArgumentOutOfRangeException(nameof(settings)),
            };
        }
예제 #3
0
 public SyslogPointFactory(InfluxDbOutputSettings settings)
 {
     _settings = settings;
 }