Docs Menu

Docs HomeMongoDB Ops Manager

Manage Ops Manager Application Logs

On this page

  • Available Ops Manager Logs
  • Change Ops Manager Log Retention
  • Change Ops Manager Log Rotation Policy

You can use Ops Manager to review a variety of log files:

  • MongoDB process logs (mongod, mongos)

  • MongoDB Agent logs

  • Ops Manager access, backup, operations, and startup logs

You can change how long you keep some Ops Manager logs. Your company may need to keep log data for legal requirements. You can change your log retention policy to adhere to those requirements.

Each host that serves Ops Manager stores its logs in the following path:

/opt/mongodb/mms/logs/

For some logs, Ops Manager uses configuration files. Ops Manager rotates these logs daily in the following manner:

  1. Close the current log file.

  2. Compress the closed log file using gzip.

  3. Start a new log file.

Ops Manager retains each compressed log file for 30 days. After 30 days, it deletes that compressed file.

You can change the retention policy of the following logs:

Log File Name
Log Contents
Configuration File
mms[#].log, typically mms0.log
Ops Manager operations
logback.xml
daemon.log
Ops Manager backup operations
logback.xml
mms[#]-access.log, typically mms0-access.log
Ops Manager access attempts
logback-access.xml

You can manage the retention policy of the following logs using your platform's tools:

daemon-startup.log
Ops Manager backup process startup process messages
mms-migration.log
Ops Manager migration process messages
mms[#]-startup.log, typically mms0-startup.log
Ops Manager startup process messages

Ops Manager may generate additional log files in extenuating circumstances. If you find files in the log directory that aren't listed in these tables, contact MongoDB Support for assistance.

If Ops Manager logs have configuration files, you can change their log retention using these files. You cannot change log retention of these log files in the console.

Important

If you upgrade Ops Manager, it overwrites its configuration files. To set log retention after you upgrade, repeat the steps in this procedure.

1

Navigate to the /opt/mongodb/mms/conf/ directory, and locate the corresponding configuration file.

  • To change retention for mms0.log or daemon.log, open logback.xml.

  • To change retention for mms0-access.log or mms0-startup.log, open logback-access.xml.

2

Open the file in your preferred editor.

Example

The following configuration file excerpt specifies a log retention policy of 45 days.

1 <appender ...>
2 <file>${log_path}.log</file>
3 <encoder class ...>
4 <pattern>... </pattern>
5 </encoder>
6 <rollingPolicy class ...>
7 <fileNamePattern>...</fileNamePattern>
8 <maxHistory>45</maxHistory>
9 </rollingPolicy>
10 </appender>
3

Change the value between the <maxHistory> tags, in days, to retain compressed log files.

4
5

To learn more, see Start and Stop Ops Manager Application.

By default, Ops Manager rotates and compresses its logs once per day. If you have large log files, you can also rotate them by size.

To change your rotation policy to rotate logs based on both size and time:

1

Navigate to the /opt/mongodb/mms/conf/ directory, and locate the corresponding configuration file.

  • To change the rotation policy for mms0.log or daemon.log, open logback.xml.

  • To change the rotation policy for mms0-access.log or mms0-startup.log, open logback-access.xml.

2

Open the file in your preferred editor.

Example

The following configuration file excerpt shows the default time based rotation policy.

1 <appender ...>
2 <file>${log_path}.log</file>
3 <encoder class ...>
4 <pattern>... </pattern>
5 </encoder>
6 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
7 <fileNamePattern>...</fileNamePattern>
8 <maxHistory>...</maxHistory>
9 </rollingPolicy>
10 </appender>
3

Make the following changes to the log configuration file:

  1. Change the class attribute in the <rollingPolicy> tag.

  2. Change the value in the <fileNamePattern> tag.

  3. Add the <maxFileSize> and <totalSizeCap> tags after <maxHistory> to modify the log storage settings.

--- /opt/mongodb/mms/conf/logback-access.xml
+++ /opt/mongodb/mms/conf/logback-access.xml
@@ -1,4 +1,7 @@
-<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- <fileNamePattern>${log_path}.%d{yyyyMMdd}.log.gz</fileNamePattern>
- <maxHistory>30</maxHistory>
+<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${log_path}.%d{yyyyMMdd}.%i.log.gz</fileNamePattern>
+ <maxHistory>30</maxHistory>
+ <maxFileSize>100MB</maxFileSize>
+ <totalSizeCap>20GB</totalSizeCap>
</rollingPolicy>
4
5

To learn more, see Start and Stop Ops Manager Application.

Tip

See also:

←  Move Jobs from a Lost Backup Daemon to another Backup DaemonUpdate Version Manifest Manually →