Logging records system activity, user actions, and application events so you can investigate problems, review performance, and detect security issues. section 21.3
MongoDB and Atlas logs cover different parts of database operations:
- Database logs record events such as slow queries, connections, and system activity; Atlas retains them for 30 days. section 21.3.2
- Audit logs record activities such as authentication attempts and data access when database auditing is enabled. section 21.3.2
- Trigger logs cover events involving triggers, functions, and change streams; Atlas retains them for 10 days. section 21.3.2
atlas logs download <hostname> <log-type> [flags].
Use the Atlas CLI download command to retrieve a log for a specific host; find project hostnames with atlas process list. Downloadable logs are unavailable for M0 free and Flex shared clusters. section 21.3.2
mongosh session logs
mongosh stores session logs in ~/.mongodb/mongosh/<LogID>_log. It keeps up to 100 log files for 30 days; from version 1.0.5, the logging format aligns with the MongoDB server format, and credentials are redacted. section 3.2.4













