How to turn off MongoDB logging?
See original GitHub issueHi,
I’m currently running some tests with MongoDB. However, the YCSB benchmark generates a large amount of debug information as output. I normally execute the benchmark and redirect the output to a file for later analysis. However, with the amount of debug information the driver is generating these files are becoming unnecessarily large. At the very end of the run I finally get the required info such as average throughput, total runtime etc.
Example of execution:
python ./bin/ycsb run mongodb -P workloads/workloadc -p recordcount=100000
-p operationcount=20000 -p mongodb.url=mongodb://localhost:27017/ycsb
Output (sample):
19:37:35.058 [Thread-2] DEBUG org.mongodb.driver.protocol.query - Sending query of namespace ycsb.usertable on connection [connectionId{localValue:2, serverValue:337}] to server localhost:27017
19:37:35.058 [Thread-2] DEBUG org.mongodb.driver.protocol.query - Query completed
19:37:35.058 [Thread-2] DEBUG org.mongodb.driver.protocol.query - Sending query of namespace ycsb.usertable on connection [connectionId{localValue:2, serverValue:337}] to server localhost:27017
19:37:35.058 [Thread-2] DEBUG org.mongodb.driver.protocol.query - Query completed
19:37:35.058 [Thread-2] DEBUG org.mongodb.driver.protocol.query - Sending query of namespace ycsb.usertable on connection [connectionId{localValue:2, serverValue:337}] to server localhost:27017
Is there any way to turn off the debugging? (preferably without modifying the source code)
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
How do you stop Java driver logging? - MongoDB
Try using the Logger 's Level OFF ; this is a special level that can be used to turn off logging. Usage: logger.setLevel(Level.OFF)...
Read more >Mongo db log disabling - Stack Overflow
1) db.adminCommand({setParameter:1, logLevel:0 }) // from mongo shell, this can be set using config file too · 2) disable slow query profiling in ......
Read more >How to disable mongodb connection logs?
If you want to modify any of these (verbosity) settings , you can configure the systemLog.verbosity and systemLog.component.<name>.verbosity ...
Read more >How to disable mongoDB java driver logging?
I am trying to disable log outputs of mongo-java-driver-3.0.0 . ... Enable MongoDB logging in general System.setProperty("DEBUG.
Read more >Deactivate logging in the Java-driver - Google Groups
Logger.getLogger("com.mongodb").setLevel(Level.OFF); But that doesn't seem ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@vreniers - the mongodb driver is setup to use slf4j and logback-classic so you actually need a logback.xml configuration present. I used something similar to this:
Putting the logback.xml on the classpath was not sufficient, I had to specify it with a jvm property. Similar to:
This works, thank you.