- Manage Deployments >
- View Logs
View Logs¶
On this page
Overview¶
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¶
Select the Deployment tab and then the Deployment page.¶
Click view mode.¶
Click the process.¶
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¶
Select the Deployment tab and then the Deployment page.¶
Click view mode.¶
Click the deployment’s gear icon and select Edit Host.¶
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.
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¶
Select the Deployment tab and then Mongo Logs page.¶
Alternatively, you can select the Deployment page’s edit mode, then the arrow to the right of a deployment, then the gear icon drop-down list, and then Request Logs.
Request the latest logs.¶
To request the latest logs:
- Click the Manage drop-down button and select Request Server Logs.
- Select the checkboxes for the logs you want to request, then click Request Logs.
To view a log, select the Show Log link for the desired date and hostname.¶
Agent Logs¶
Ops Manager collects logs for all your Automation Agents, Monitoring Agents, and Backup Agents.
View Agent Logs¶
From any page, click an agent icon at the top of the page and select Logs.¶
Ops Manager opens the Agent Logs page and displays the log entries for agents of the same type.
You can also open the Agent Logs page by selecting the Administration tab, then Agents page, and then view logs link for a particular agent. The page displays the agent’s log entries.
Filter the log entries.¶
Use the drop-down list at the top of the page to display different types of agents.
Use the gear icon to the right of the page to clear filters and to export logs.
Configure Agent Log Rotation¶
Select the Administration tab and then Agents page.¶
Edit the log settings.¶
Under the Agent Log Settings header, click the pencil icon to edit the log settings for the appropriate agent.
You can modify the following fields:
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. |
When you are done modifying the agent log settings, click Confirm.