Skip to content

Commit

Permalink
separate noderd-kafka consumer and producer logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerkesni committed Oct 6, 2023
1 parent ecc6c67 commit 3c62125
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions lib/BackbeatConsumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ class BackbeatConsumer extends EventEmitter {
}
this._consumer = new kafka.KafkaConsumer(consumerParams, topicParams);

this._consumer.on('event', event => this._log.info('rdkafka.event', { event }));
this._consumer.on('event.log', log => this._log.info('rdkafka.log', { log }));
this._consumer.on('warning', warning => this._log.warn('rdkafka.warning', { warning }));
this._consumer.on('event.error', err => this._log.error('rdkafka.error', { err }));
this._consumer.on('event.throttle', throttle => this._log.info('rdkafka.throttle', { throttle }));
this._consumer.on('event', event => this._log.info('consumer.rdkafka.event', { event }));
this._consumer.on('event.log', log => this._log.info('consumer.rdkafka.log', { log }));
this._consumer.on('warning', warning => this._log.warn('consumer.rdkafka.warning', { warning }));
this._consumer.on('event.error', err => this._log.error('consumer.rdkafka.error', { err }));
this._consumer.on('event.throttle', throttle => this._log.info('consumer.rdkafka.throttle', { throttle }));
this._consumer.on('event.stats', observeKafkaStats);

this._connect();
Expand Down
10 changes: 5 additions & 5 deletions lib/BackbeatProducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ class BackbeatProducer extends EventEmitter {

this._producer = new Producer(this.producerConfig, this.topicConfig);

this._producer.on('event', event => this._log.info('rdkafka.event', { event }));
this._producer.on('event.log', log => this._log.info('rdkafka.log', { log }));
this._producer.on('warning', warning => this._log.warn('rdkafka.warning', { warning }));
this._producer.on('event.error', err => this._log.error('rdkafka.error', { err }));
this._producer.on('event.throttle', throttle => this._log.info('rdkafka.throttle', { throttle }));
this._producer.on('event', event => this._log.info('producer.rdkafka.event', { event }));
this._producer.on('event.log', log => this._log.info('producer.rdkafka.log', { log }));
this._producer.on('warning', warning => this._log.warn('producer.rdkafka.warning', { warning }));
this._producer.on('event.error', err => this._log.error('producer.rdkafka.error', { err }));
this._producer.on('event.throttle', throttle => this._log.info('producer.rdkafka.throttle', { throttle }));
this._producer.on('event.stats', observeKafkaStats);

this.connect();
Expand Down

0 comments on commit 3c62125

Please sign in to comment.