MongoDB Logging Basics
Learn about MongoDB deployment logs in more detail. It covers log access, event interpretation, and verbosity, using both Atlas and self-managed deployments. You will also learn how to approach log rotation and retention.
MongoDB Logging Basics
Unit Overview
In this unit, you'll learn about logs for both self-managed and Atlas deployments, and how to interpret and use them effectively. You'll first download logs in Atlas and locate them for self-managed deployments. Then, you'll explore some of the information that logs can provide, including authorization attempts and startup warnings. Finally, you'll learn about MongoDB's approach to log rotation and retention, and why both are important.
Prerequisites
Lessons in This Unit
- Lesson 1 – MongoDB Logs in Atlas
- Lesson 2 – MongoDB Logs on Self-Managed Instances
- Lesson 3 – MongoDB Log Events
- Lesson 4 – MongoDB Server Log Customizations
- Lesson 5 – MongoDB Server Log Rotation and Retention
-
01.
-
02.Lesson 2: MongoDB Logs on Self-Managed Instances
- Learn
- Practice
-
03.Lesson 3: MongoDB Log Events
- Learn
- Practice
-
04.Lesson 4: MongoDB Server Log Customizations
- Learn
- Practice
-
05.Lesson 5: MongoDB Server Log Rotation and Retention
- Learn
- Practice
-
06.Conclusion
- Learn
John McCambridge | University Curriculum Engineer
John is a Curriculum Engineer on the University team at MongoDB. Before his work as a Curriculum Engineer, he was an instructor and teaching assistant for coding boot camps at UT (Austin) and UCLA. Additionally, he worked as a QA engineer for a startup called Coder and spent five years at Apple Inc. John is a passionate software engineer and educator who enjoys taking complex topics and making them digestible for the community.
Sarah Evans | Senior Curriculum Engineer
Sarah is a Senior Curriculum Engineer on the Curriculum team at MongoDB. Prior to MongoDB, she taught and developed curricula for developer bootcamps. Sarah has a MAT degree from Columbia University Teachers College and studied Software Engineering at Flatiron School in Chicago, IL.
Vick Mena | Director, Curriculum
My name is Vick and I've been in the wild for over 25 years. I grew up at IBM working on the BIOS for the IBM eServer line in Austin, TX before moving to Wall St. I've worked on all phases of software development from low-level to middleware to UI but feel most comfortable in the middle. I also drank the devops kool-aid having moved a product line to AWS while at Dow Jones & Co with the help of an amazing team. I then pivoted into the secure space and worked on software/hardware reverse engineering. I always thought I'd eventually teach and this role lets me leverage all of my experience to lead this motley crew of passionate educators.
Welcome to this unit on MongoDB logging basics. In this unit, we’ll cover how to download and locate logs, as well as how to rotate logs and adjust retention. We’ll also take a look at some examples of log messages.
My name is Sarah. I’m a Curriculum Engineer here at MongoDB, and I’ll be your guide through this unit.
Logs are an essential part of a MongoDB deployment.
Learning how to use the logging features of MongoDB will help you diagnose issues, monitor your deployment, and tune performance.
Logging events and their interpretation can be a powerful tool in the DBA toolbox.
First, you’ll learn how to download logs in Atlas and locate logs for self-managed deployments.
Next, we will look at some interesting events in MongoDB logs, such as authorization attempts, replica set elections and startup warnings.
Finally, we will show you how to rotate logs by using the Linux logrotate utility and explain how retention is handled.
The logs in this unit are formatted by using the Linux json query utility, `jq`, to enhance readability.
Throughout this unit, you'll have plenty of opportunities to practice what you learned by completing labs and quizzes that present real-world scenarios. This way, you'll build your knowledge and get comfortable with the tools at the same time.
Before you begin, we recommend that you have some familiarity with self-managed MongoDB deployments and MongoDB Atlas.
By the end of this unit, you’ll be able to gather and assess what’s happening under the hood of your self-managed deployment or Atlas cluster. Let’s get started!