Exemple #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));
        }
        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)),
            };
        }
Exemple #3
0
 public SyslogPointFactory(InfluxDbOutputSettings settings)
 {
     _settings = settings;
 }