コード例 #1
0
        public KafkaLoggerProvider(IOptionsMonitor <KafkaLoggerOptions> options)
        {
            loggerOptions = options.CurrentValue;

            producer                 = KafkaProducer.Create(loggerOptions);
            producer.DefaultKey      = loggerOptions.Key;
            producer.DefaultTopic    = loggerOptions.Topic;
            producer.InitializeCount = loggerOptions.InitializeCount;
        }
コード例 #2
0
 public KafkaLogger(string category, KafkaLoggerOptions options, KafkaProducer producer)
 {
     this.category      = category ?? "";
     this.loggerOptions = options;
     this.producer      = producer;
 }