Help MongoDB Logs

MongoDB Logs

MongoDB logs contain critical log related information that can be used to obtain essential insights by splitting them into associated fields such as date & time, log level, component, context, and message. Site24x7 AppLogs is a log management product that facilitates simple log management by pooling all your logs in one single interface. Site24x7 AppLogs natively supports MongoDB along with other critical applications.  Learn more about log management with Site24x7

Getting started

  1. Log in to your Site24x7 account.
  2. Download and install the Site24x7 Server Monitoring agent (Windows | Linux). 
  3. Go to Admin > AppLogs > Log Profile and Add Log Profile.

Logs file path

Each application writes logs in different folders and files. By default, MongoDB logs are sourced from the below-mentioned folder path for the respective Operating System. If you have logs in a different folder, you can mention it under the File Path to source them from that particular folder while creating a log profile.

Linux icon
:
/var/log/mongodb/*.log
Windows icon
:
C:\mongodb*\logs\*.log*
 
 
C:\Program Files\mongodb*\logs\*.log*

Log pattern

$DateTime:date$ $LogLevel$ $Component$ [$Context$] $Message$

This is the default pattern defined by Site24x7 for parsing MongoDB logs based on the sample mentioned below.

Sample log

2017-06-07T12:22:33.456-700 I NETWORK [initandlisten] waiting

The above sample log can be separated into 5 fields, each of which will take its respective value from here and will then be uploaded to Site24x7.

Field name Field value
Date Time 2017-06-07T12:22:33.456-700 
Log Level I
Component NETWORK
Context initandlisten
Message waiting

Related log types

Was this document helpful?
Thanks for taking the time to share your feedback. We’ll use your feedback to improve our online help resources.

Help MongoDB Logs