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 b322ad9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions lib/BackbeatConsumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,12 @@ 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.stats', observeKafkaStats);
this._consumer.on('event consumer', event => this._log.info('rdkafka.event', { event }));
this._consumer.on('event.log consumer', log => this._log.info('rdkafka.log', { log }));
this._consumer.on('warning consumer', warning => this._log.warn('rdkafka.warning', { warning }));
this._consumer.on('event.error consumer', err => this._log.error('rdkafka.error', { err }));
this._consumer.on('event.throttle consumer', throttle => this._log.info('rdkafka.throttle', { throttle }));
this._consumer.on('event.stats consumer', observeKafkaStats);

this._connect();
}
Expand Down
12 changes: 6 additions & 6 deletions lib/BackbeatProducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ 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.stats', observeKafkaStats);
this._producer.on('event producer', event => this._log.info('rdkafka.event', { event }));
this._producer.on('event.log producer', log => this._log.info('rdkafka.log', { log }));
this._producer.on('warning producer', warning => this._log.warn('rdkafka.warning', { warning }));
this._producer.on('event.error producer', err => this._log.error('rdkafka.error', { err }));
this._producer.on('event.throttle producer', throttle => this._log.info('rdkafka.throttle', { throttle }));
this._producer.on('event.stats producer', observeKafkaStats);

this.connect();
this.setListeners();
Expand Down

0 comments on commit b322ad9

Please sign in to comment.