Manage Ops Manager Application Logs
On this page
You can use Ops Manager to review a variety of log files:
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.
Available Ops Manager Logs
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:
Close the current log file.
Compress the closed log file using
gzip
.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.
Change Ops Manager Log Retention
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.
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 <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>
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 based on both size and time:
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 <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>
Modify the new log rotation policy.
Make the following changes to the log configuration file:
Change the
class
attribute in the<rollingPolicy>
tag.Change the value in the
<fileNamePattern>
tag.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 -<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>
Restart Ops Manager for the changes to take effect.
To learn more, see Start and Stop Ops Manager Application.