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

Pass custom logger #14

Closed
arshad1tixsee opened this issue Sep 27, 2017 · 6 comments
Closed

Pass custom logger #14

arshad1tixsee opened this issue Sep 27, 2017 · 6 comments
Labels

Comments

@arshad1tixsee
Copy link

can i pass cutom logger we have customized bunyan logger and using it in all the application need to pass that logger to pg-monitor to log.info all the queries passed to pg promise

@vitaly-t
Copy link
Owner

Sure, why not? You can just set info.display = false, and that's it, it won't display anything on screen ;)

https://github.com/vitaly-t/pg-monitor#log

@arshad1tixsee
Copy link
Author

sorry may be my question phrase is not right I need pg-monitor to print log on my logger when i make a file out of my logger i can see those as well currently pg-monitor logs are independent of my bunyan logger wrapper

@vitaly-t
Copy link
Owner

vitaly-t commented Sep 27, 2017

Ok, I see now...

pg-monitor is all about handling events from pg-promise, formatting messages and displaying them. From what you are telling me, you don't need any of that, which means you do not need pg-nonitor at all.

Instead, you should handle pg-promise events yourself, which is what pg-monitor does, and then output those events as you please.

@vitaly-t
Copy link
Owner

Alternatively, you can set up a dual system, if you want, as pg-monitor intelligently adds event handlers, it doesn't override them, unless you ask it to.

@arshad1tixsee
Copy link
Author

ok I will reuse the code in pg-monitor and override print function thanks for your help

@vitaly-t
Copy link
Owner

vitaly-t commented Sep 27, 2017

More or less, though the whole pg-monitor code is a bit of an overkill for what you want. You won't need half of it ;)

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

No branches or pull requests

2 participants