public KafkaLoggerProvider(IOptionsMonitor <KafkaLoggerOptions> options)
        {
            loggerOptions = options.CurrentValue;

            producer                 = KafkaProducer.Create(loggerOptions);
            producer.DefaultKey      = loggerOptions.Key;
            producer.DefaultTopic    = loggerOptions.Topic;
            producer.InitializeCount = loggerOptions.InitializeCount;
        }
Exemplo n.º 2
0
 public KafkaLogger(string category, KafkaLoggerOptions options, KafkaProducer producer)
 {
     this.category      = category ?? "";
     this.loggerOptions = options;
     this.producer      = producer;
 }