1

Why mongodb.log does not have detailed log, for example update, delete, insert sql log?

Superman
  • 285
  • 5
  • 17

2 Answers2

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
  1. set the profiling level db.setProfilingLevel(2) 2.Check Profiling Level db.getProfilingStatus() result { "was" : 2, "slowms" : 100 }
  2. get logresult db.system.profile.find()

enter image description here

refer to: https://docs.mongodb.com/manual/reference/database-profiler/

Catarina Ferreira
  • 1,824
  • 5
  • 17
  • 26
Dongzhc
  • 26
  • 4