I am new to mongodb and trying to figure out a lot.
Can we configure shell logging for mongodb? What I mean is the capability to get logs from the Shell to track queries for auditing purposes for version 4?
If so - what commands do we have to run please?
Thank you for your help
There are two versions of MongoDB shell: the newer mongosh and the older/legacy mongo shell.
mongomaintains a history of commands in the .dbshell file. For example, in the Windows 7 environment this can be found at the folder:C:\Users\<user_name>MongoDB Shell
mongoshstores logs for each session and can be retrieved as explained at: Retrieve Shell Logs. For example, in Windows environment this can be found at the folder:C:\Users\<user_name>\AppData\Local\. The log files are of the format<LogID>_log.