How to use the kafka-node/logging.setLoggerProvider function in kafka-node

To help you get started, we’ve selected a few kafka-node examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github al66 / imicros-flow / lib / flow.static.subscriber.mixed.js View on Github external
clientId: this.clientId,
          brokers: this.brokers,
          logLevel: 5, //logLevel.DEBUG,
          logCreator: this.serviceLogger
        })

        // Map kafka-node log to service logger
        let serviceLogger = (name) => {
            return {
                debug: this.logger.debug,
                info: this.logger.info,
                warn: this.logger.warn,
                error: this.logger.error
            }
        }
        kafkaLogging.setLoggerProvider(serviceLogger);

        // Must be required after custom logger is set
        kafka = require('kafka-node')
        HighLevelProducer = kafka.HighLevelProducer;

        this.topics = {
            events: this.settings.topics ? this.settings.topics.events || 'events' : 'events'
        }
        
        this.subscriptions = [];
        this.consumers = [];
        
    },