You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i just tried use mongo client and, i want to logging query sentences in the console.
I used this properties: quarkus.log.category."org.mongodb.driver.protocol.command".level=DEBUG.
It did logged the query:
2022-03-14 15:25:16,165 DEBUG [org.mon.dri.pro.command] (executor-thread-0) Sending command '{"aggregate": "user", "pipeline": [{"$match": {"$and": [{"$and": [{"name": "user"}]}]}}, {"$group": {"_id": 1, "n": {"$sum": 1}}}], "cursor": {}, "$db": "xnzk_lcdp", "lsid": {"id": {"$binary": {"base64": "GH3rZIIhRH+L8pXVZvvgdw==", "subType": "04"}}}}' with request id 9 to database xnzk_lcdp on connection [connectionId{localValue:3, serverValue:43}] to server localhost:27017
however, it also logged unneccessary health info:
2022-03-14 15:25:16,408 DEBUG [org.mon.dri.pro.command] (cluster-rtt-ClusterId{value='622eedd223df9c41d639f652', description='null'}-localhost:27017) Sending command '{"hello": 1, "$db": "admin"}' with request id 12 to database admin on connection [connectionId{localValue:1, serverValue:41}] to server localhost:27017
2022-03-14 15:25:16,411 DEBUG [org.mon.dri.pro.command] (cluster-rtt-ClusterId{value='622eedd223df9c41d639f652', description='null'}-localhost:27017) Execution of command with request id 12 completed successfully in 3.75 ms on connection [connectionId{localValue:1, serverValue:41}] to server localhost:27017
in fact, the second log is unneccessary as well.
my question is how to logging the real query sentences only.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
i just tried use mongo client and, i want to logging query sentences in the console.
I used this properties: quarkus.log.category."org.mongodb.driver.protocol.command".level=DEBUG.
It did logged the query:
however, it also logged unneccessary health info:
in fact, the second log is unneccessary as well.
my question is how to logging the real query sentences only.
can someone help me?
Beta Was this translation helpful? Give feedback.
All reactions