How does mongodb output its own log to the console, such as inserting content, etc.
Output in logback. I don’t know what that configuration is. Does a great god know?
Show_sql settings similar to hibernate.
I don’t know if I understand it, if I don’t
forkNor does it specify
logpathThe log is output to the console.
According to your comments, the following are the updated contents.
The function you want is to record CRUD statements. There are several implementations (choose one of them):
- Using Enterprise EditionAudit log(not detailed);
Record slow query log
- By default, execution exceeds
100msThe statement of will be recorded to the
mongod.log(that is, the kind of journal mentioned in your comment)
- You can use the parameters in the configuration fileslowOpThresholdMsModify the threshold value of the record statement (all records can be recorded if it is modified to 0);
- You can also execute it directly from the command line without modifying the configuration file (avoiding restart):
db.setProfilingLevel(0, 0)Online modification of slow query threshold;
Either of the above methods can achieve the goal, but it needs to be understood that recording all statements will cause extra burden on the database.May have a very serious impact on database performanceTherefore, it is only recommended to open it temporarily when troubleshooting problems and close it as soon as possible after completion.