Lesson 4: Logging Basics / Learn

Code Summary: Logging Basics

Review the following code, which demonstrates how to access the log file by using the Atlas CLI.

List Processes

From the MongoDB Shell, run the following command to retrieve the hostname for your process:

atlas processes list

Download Logs

Use the following code to download logs from a cluster node:

atlas logs download <hostname> <mongodb.gz|mongos.gz|mongosqld.gz|mongodb-audit-log.gz|mongos-audit-log.gz> [flags]