Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How to log queries? #2580

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

Closed
spa5k opened this issue Jul 25, 2021 · 1 comment
Closed

How to log queries? #2580

spa5k opened this issue Jul 25, 2021 · 1 comment
Labels

Comments

@spa5k
Copy link

spa5k commented Jul 25, 2021

Is there any way to log queries, and it's parameter while using this library?

The option provided here does not work and is giving types error.

Feature request - maybe an inbuilt logger than can be enabled by simply doing logger:true while initializing the client.

@brianc
Copy link
Owner

brianc commented Jul 27, 2021

There's no currently built in logger. I recommend wrapping the library w/ a small lib in your project so you can handle various things in whichever way is best suited to your project. Node doesn't really have a standard "blessed" logger & I'd rather not add any overhead to the lib by logging things. There are also potential security concerns around logging query text (and/or parameters) as they can contain sensitive information so it's something best left up to user space code to handle! You can also monkey patch the query method on the client instance if that's how you like to roll.

@brianc brianc closed this as completed Jul 27, 2021
@spa5k spa5k changed the title How to log queires? How to log queries? Jul 27, 2021
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

3 participants