Why mongodb.log does not have detailed log, for example update, delete, insert
sql log?
Asked
Active
Viewed 3,112 times
1

Superman
- 285
- 5
- 17
-
I can not find the same question,Could you help me provide the link? Thank you! – Superman May 12 '17 at 01:01
-
1Is you question [this](http://stackoverflow.com/q/15204341/2185245)? It has some suggestions which might help. – Abhishek May 12 '17 at 04:55
-
@Abhishek, thank you very much! – Superman May 12 '17 at 05:38
-
Possible duplicate of [MongoDB logging all queries](http://stackoverflow.com/questions/15204341/mongodb-logging-all-queries) – Bill Tür stands with Ukraine May 12 '17 at 11:58
2 Answers
1
Logging all the operations would have a big impact on your database performance, that 's why by default nothing is log.
However, you can play with the database profiler if you really want them. https://docs.mongodb.com/manual/tutorial/manage-the-database-profiler/

bappr
- 175
- 2
- 9
1
- set the profiling level
db.setProfilingLevel(2)
2.Check Profiling Leveldb.getProfilingStatus()
result{ "was" : 2, "slowms" : 100 }
- get logresult
db.system.profile.find()
refer to: https://docs.mongodb.com/manual/reference/database-profiler/

Catarina Ferreira
- 1,824
- 5
- 17
- 26

Dongzhc
- 26
- 4