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

Can't be used in conjunction with pino-elasticsearch #27

Open
audishos opened this issue Jun 9, 2020 · 2 comments
Open

Can't be used in conjunction with pino-elasticsearch #27

audishos opened this issue Jun 9, 2020 · 2 comments

Comments

@audishos
Copy link

audishos commented Jun 9, 2020

Since the pino-elasticsearch library implements @elastic/elasticsearch which calls debug, you must initialize pino-debug before creating your logger instance which prevents you from being able to pass that logger instance into pino-debug. This means that while you are able to initialize pino-debug before creating your logger instance, it will use a separate logger instance and therefore, these logs cannot be sent to elasticsearch.

I wonder if it's possible to allow debug calls before initializing pino-debug with the understanding that these calls will not be sent to the logger.

@mcollina
Copy link
Member

mcollina commented Jun 9, 2020

This is unfortunate but true :(. I don't know if a PR to adjust this would be possible. In case, we'll be happy to land it.

@audishos
Copy link
Author

I gave it a shot - #28
credit to https://github.com/krakenjs/freshy for the code snippet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants