public ValuesController(ILogger <ValuesController> logger, IElasticSearchHelper esHelper) { _esHelper = esHelper; _logger = logger; }
public CustomLoggerProvider(CustomLoggerConfiguration config, IElasticSearchHelper esHelper) => (_config, _esHelper) = (config, esHelper);
// public static ILoggingBuilder AddCustomLogger(this ILoggingBuilder builder) => builder.AddCustomLogger(new CustomLoggerConfiguration(),); public static ILoggingBuilder AddCustomLogger(this ILoggingBuilder builder, Action <CustomLoggerConfiguration> configure, IElasticSearchHelper esHelper) { var config = new CustomLoggerConfiguration(); configure(config); return(builder.AddCustomLogger(config, esHelper)); }
public static ILoggingBuilder AddCustomLogger(this ILoggingBuilder builder, CustomLoggerConfiguration config, IElasticSearchHelper esHelper) { builder.AddProvider(new CustomLoggerProvider(config, esHelper)); return(builder); }
public CustomLogger(string name, CustomLoggerConfiguration config, IElasticSearchHelper esHelper) => (_name, _config, _esHelper) = (name, config, esHelper);