Page tree
Skip to end of metadata
Go to start of metadata
$ mongo
MongoDB shell version: 2.4.9
connecting to: test
> use myDb
switched to db myDb
> db.getProfilingLevel()
0
> db.setProfilingLevel(2)
{ "was" : 0, "slowms" : 1, "ok" : 1 }
> db.getProfilingLevel()
2
> db.system.profile.find().pretty()

db.setProfilingLevel(2) means "log all operations".


Source: http://docs.mongodb.org/manual/reference/method/db.setProfilingLevel/


参考:https://stackoverflow.com/questions/15204341/mongodb-logging-all-queries

  • No labels
Write a comment…