Navigation
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.

Manage Ops Manager Application Logs

In addition to viewing logs for mongod and mongos processes and agents, you can explore Ops Manager logs, such as its access and backup logs.

You can change how long you store some of the Ops Manager logs. Setting this retention policy can keep Ops Manager consistent with your organization’s data retention policies.

Available Ops Manager Logs

Ops Manager Application stores its own logs in the /opt/mongodb/mms/logs/ directory of each Ops Manager host.

Some of the logs have a configuration file that Ops Manager maintains. Ops Manager rotates such logs daily. For these logs, Ops Manager:

  • Closes the current file.
  • Compresses the closed file using gzip.
  • Starts a new log file.

Ops Manager retains each compressed file for 30 days, then deletes the 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
mms[#]-startup.log, typically mms0-startup.log Ops Manager startup process messages 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

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.

Change Ops Manager Log Retention

If Ops Manager Application 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 customize log retention after you upgrade, repeat the steps in this procedure.

1

Locate the configuration file.

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 configuration file.

Open the file in your preferred editor.

Example

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

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

Specify a new log retention value.

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

4

Save the file.

5

Restart Ops Manager for the changes to take effect.

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

Change Ops Manager Log Rotation Policy

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 by size and time:

1

Locate the configuration file.

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 configuration file.

Open the file in your preferred editor.

Example

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

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

Specify the new log rotation policy.

Change the class attribute in the <rollingPolicy> tag to match the following entry:

<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
4

Save the file.

5

Restart Ops Manager for the changes to take effect.

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