loopback-connector-mongodb icon indicating copy to clipboard operation
loopback-connector-mongodb copied to clipboard

Debug does not output query

Open wojohowitz opened this issue 11 years ago • 6 comments

While running in the repl with debug: true on the adapter, I do not get the query output like I would for an RDBMS adapter.

wojohowitz avatar Apr 12 '15 20:04 wojohowitz

I need to console the query which is executing on models which included many relations. Please help me if possible.

iamprohaktiv avatar Oct 24 '16 06:10 iamprohaktiv

What version of the loopback-connector-mongodb are you using?

There is debug available here: https://github.com/strongloop/loopback-connector-mongodb/blob/master/lib/mongodb.js#L284

Is this not sufficient? Can you please provide an example of query and more information on this please? Thanks

smartmouse avatar Feb 08 '17 04:02 smartmouse

You can turn on the debug by setting the DEBUG environment variable.
DEBUG=loopback:connector:mongodb

dhmlau avatar Apr 04 '17 13:04 dhmlau

@wojohowitz , with the answer above, is this issue good to close?

dhmlau avatar May 07 '17 01:05 dhmlau

For security reasons we do not log the query output rather just log the query itself. The query output may contain confidential information for the user and it is recommended to not debug log the query output.

Closing this issue as it is resolved. Feel free to reopen if needed.

ssh24 avatar Jun 19 '17 17:06 ssh24

If sb can see the log of an app they already pass through every security so it doesn't make sense if you prevent displaying sql query in order to not having security issue. It's necessary for me as a developer to see my log. please add this feature to loopback and if you have a strong reason for security it's better just warn the developer in document.

kouroshezzati avatar Jun 30 '19 05:06 kouroshezzati