This version of the documentation is archived and no longer supported. To learn how to upgrade your version of MongoDB Ops Manager, refer to the upgrade documentation.
You were redirected from a different version of the documentation. Click here to go back.

View Logs


Ops Manager collects log information for both MongoDB and the Ops Manager agents. For MongoDB deployments, Ops Manager provides access to both real-time logs and on-disk logs.

The MongoDB logs provide the diagnostic logging information for your mongod and mongos instances. The Agent logs provide insight into the behavior of your Ops Manager agents.

MongoDB Real-Time Logs

The Monitoring Agent collects real-time log information from each MongoDB deployment by issuing the getLog command with every monitoring ping. The getLog command collects log entries from the MongoDB RAM cache.

Ops Manager enables real-time log collection by default. You can disable log collection for either the whole Ops Manager group or for individual MongoDB instances. If you disable log collection, Ops Manager continues to display previously collected log entries.

View MongoDB Real-Time Logs


Click Deployment, then the Processes tab, then the Topology view.


If the process is part of a sharded cluster, click the filter button for the type of process.

Click one of the following:

Shards Displays the mongod processes that host your data.
Configs Displays the mongod processes that run as config servers to store a sharded cluster’s metadata.
Mongos Displays the mongos processes that route data in a sharded cluster.

On the line listing the process, click Metrics.


Click the Logs tab.

The tab displays log information. If the tab instead diplays the Collect Logs For Host option, toggle the option to On and refresh the page.


Refresh the browser window to view updated entries.

Enable or Disable Log Collection for a Deployment


Click Deployment, then the Processes tab, then the Topology view.


On the line for any process, click the ellipsis icon and select Monitoring Settings.


Click the Logs tab and toggle the Off/On button as desired.


Click X to close the Edit Host box.

The deployment’s previously existing log entries will continue to appear in the Logs tab, but Ops Manager will not collect new entries.

Enable or Disable Log Collection for the Group


Click Settings, then Group Settings.


Set the Collect Logs For All Hosts option to On or Off, as desired.

MongoDB On-Disk Logs

Ops Manager can collect on-disk logs even if the MongoDB instance is not running. The Automation Agent collects the logs from the location specified by the MongoDB systemLog.path configuration option. The MongoDB on-disk logs are a subset of the real-time logs and therefore less verbose.

You can configure log rotation for the on-disk logs. Ops Manager enables log rotation by default.

View MongoDB On-Disk Logs


Click Deployment, then the More drop-down list, then MongoDB Logs.

Alternatively, you can select the ellipsis icon for a process and select Request Logs.


Request the latest logs.

To request the latest logs:

  1. Click the Manage drop-down button and select Request Server Logs.
  2. Select the checkboxes for the logs you want to request, then click Request Logs.

Configure Log Rotation


Click Deployment, then :the More drop-down list, then MongoDB Logs.


Click the Manage drop-down button and select MongoDB Log Settings.


Configure the log rotation settings and click Save.


Click Review & Deploy.


Click Confirm & Deploy.

Agent Logs

Ops Manager collects logs for all your Automation Agents, Monitoring Agents, and Backup Agents.

View Agent Logs


Click Deployment, then the Agents tab, then Agent Logs.

The page displays logs for the type of agent selected in the View drop-down list. The page filters logs according to any filters selected in through the gear icon.


Filter the log entries.

To display logs for a different type of agent, use the View drop-down list.

To display logs for a specific hosts or MongoDB processes, click the gear icon and make your selections.

To clear filters, click the gear icon and click Remove Filters.

To download the selected logs, click the gear icon and click Download as CSV File.


To view logs for a specific agent, you can alternatively click the Agents tab’s All Agents list and then click view logs for the agent.

Configure Agent Log Rotation

If you are using Automation to manage your cluster, use the following procedure to configure rotation of the agent log files.


If you are not using Automation, see the following documentation for information about how to manually configure logging settings in the agent configuration files:


Click Deployment, then the Agents tab.


Click Downloads & Settings.


Scroll down to the Agent Log Settings section.


Edit the log settings.

Click the pencil icon to edit an agent’s log settings. You can edit the following settings. When you are done, click Confirm:

Name Type Description
Linux Log Path string The path to which the agent writes its logs.
Rotate Logs boolean Specifies whether Ops Manager should rotate the logs for the agent.
Size Threshold (MB) number Max size in MB for an individual log file before rotation.
Time Threshold (Hours) integer Max time in hours for an individual log file before rotation.
Max Uncompressed Files integer Optional Max number of total log files to leave uncompressed, including the current log file.
Max Percent of Disk number Optional Max percent of the total disk space all log files can occupy before deletion.

Click Review & Deploy to review your changes.


Review and approve your changes.

Ops Manager displays your proposed changes.

  1. If you are satisfied, click Confirm & Deploy.
  2. Otherwise, click Cancel and you can make additional changes.