Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose logger #96

Closed
Nevon opened this issue Jul 29, 2018 · 0 comments
Closed

Expose logger #96

Nevon opened this issue Jul 29, 2018 · 0 comments

Comments

@Nevon
Copy link
Collaborator

Nevon commented Jul 29, 2018

I'm currently building a "plugin" that wraps around consumer.eachMessage. In some cases, I would like to log some information. At the moment, the user needs to provide the logger to the plugin, but I would rather be able to get KafkaJS's logger from the consumer or producer, so that I can log "as" kafkajs (in the same format, following the same log level settings).

For example:

const client = new Kafka({ ... })

const consumer = kafka.consumer({ ... })
const consumerLogger = consumer.logger()

const producer = kafka.producer({ ... })
const producerLogger = producer.logger()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant