Skip to content

Commit 759d2f8

Browse files
authored
(DOCSP-32750) Adds specs for configuring log rotation. (#1452)
* (DOCSP-32750) Adds specs for configuring log rotation. * Revises per copy review.
1 parent f315226 commit 759d2f8

File tree

1 file changed

+111
-0
lines changed

1 file changed

+111
-0
lines changed

source/reference/k8s-operator-om-specification.txt

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,117 @@ Optional |onprem| Resource Settings
152152
and Monitoring separately in ``spec.applicationDatabase.agent`` and
153153
``spec.applicationDatabase.monitoringAgent``.
154154

155+
.. opsmgrkube:: spec.applicationDatabase.agent.logRotate
156+
157+
*Type*: object
158+
159+
MongoDB configuration object for rotating the MongoDB logs of a process. To use
160+
the ``agent.logRotate`` settings, you must set
161+
:opsmgrkube:`systemLog.destination <spec.applicationDatabase.agent.systemLog.destination>`
162+
to ``file`` because you can't use the ``agent.logRotate`` settings if you're writing
163+
logs to the host's :manual:`syslog </reference/glossary/#std-term-syslog>` system.
164+
165+
.. opsmgrkube:: spec.applicationDatabase.agent.logRotate.numTotal
166+
167+
*Type*: integer
168+
169+
*Default*: ``0``
170+
171+
Total number of log files that |mms| retains. If you don't change the default,
172+
|mms| bases rotation on your other ``agent.logRotate`` settings.
173+
174+
.. opsmgrkube:: spec.applicationDatabase.agent.logRotate.numUncompressed
175+
176+
*Type*: integer
177+
178+
*Default*: ``5``
179+
180+
Maximum number of total log files to leave uncompressed,
181+
including the current log file.
182+
183+
.. opsmgrkube:: spec.applicationDatabase.agent.logRotate.percentOfDiskspace
184+
185+
*Type*: number
186+
187+
*Default*: ``0.02``
188+
189+
Maximum percentage of total disk space that |mms| can use to
190+
store the log files expressed as decimal. If this limit is
191+
exceeded, |mms| deletes compressed log files until it meets this
192+
limit. |mms| deletes the oldest log files first.
193+
194+
.. opsmgrkube:: spec.applicationDatabase.agent.logRotate.sizeThresholdMB
195+
196+
*Type*: number
197+
198+
*Required if rotating logs.*
199+
200+
Maximum size in MB for an individual log file before |mms|
201+
rotates it. |mms| rotates the log file immediately if it meets
202+
the value given in either this ``sizeThresholdMB`` or the
203+
:opsmgrkube:`logRotate.timeThresholdHrs <spec.applicationDatabase.agent.logRotate.timeThresholdHrs>` limit.
204+
205+
.. opsmgrkube:: spec.applicationDatabase.agent.logRotate.timeThresholdHrs
206+
207+
*Type*: integer
208+
209+
*Required if rotating logs*.
210+
211+
Maximum duration in hours for an individual log file before the
212+
next rotation. The time is since the last rotation. |mms| rotates the log file
213+
immediately if it meets the value given in either this ``timeThresholdHrs`` or the
214+
:opsmgrkube:`logRotate.sizeThresholdM <spec.applicationDatabase.agent.logRotate.sizeThresholdM>` limit.
215+
216+
.. opsmgrkube:: spec.applicationDatabase.agent.systemLog
217+
218+
*Type*: object
219+
220+
MongoDB configuration object for configuring the ``systemLog`` options.
221+
222+
.. opsmgrkube:: spec.applicationDatabase.agent.systemLog.path
223+
224+
*Type*: string
225+
226+
*Default:* ``/var/log/mongodb-mms-automation/mongodb.log``
227+
228+
The path of the log file to which |mongod| or |mongos| should send all diagnostic
229+
logging information, rather than the standard output or the host's
230+
:manual:`syslog </reference/glossary/#std-term-syslog>`.
231+
MongoDB creates the log file at the specified path.
232+
233+
The Linux package init scripts don't expect ``systemLog.path`` to change from the defaults.
234+
If you use the Linux packages and change ``systemLog.path``, you will have to use your own
235+
init scripts and disable the built-in scripts.
236+
237+
.. opsmgrkube:: spec.applicationDatabase.agent.systemLog.logAppend
238+
239+
*Type:* boolean
240+
241+
*Default:* ``false``
242+
243+
When ``true``, |mongos| or |mongod| appends new entries to the end of the existing
244+
log file when the |mongos| or |mongod| instance restarts. Without this option, |mongod|
245+
will back up the existing log and create a new file.
246+
247+
.. opsmgrkube:: spec.applicationDatabase.agent.systemLog.destination
248+
249+
*Type:* string
250+
251+
The destination to which MongoDB sends all log output. Specify either ``file`` or ``syslog``.
252+
If you specify ``file``, you must also specify
253+
:opsmgrkube:`systemLog.path <spec.applicationDatabase.agent.systemLog.path>`.
254+
255+
If you don't specify
256+
:opsmgrkube:`systemLog.path <spec.applicationDatabase.agent.systemLog.path>`, MongoDB
257+
sends all log output to standard output.
258+
259+
.. warning::
260+
261+
The syslog daemon generates timestamps when it logs a message, not when MongoDB
262+
issues the message. This behavior can lead to misleading timestamps for log entries,
263+
especially when the system is under heavy load. We recommend using the ``file``
264+
option for production systems to ensure accurate timestamps.
265+
155266
.. opsmgrkube:: spec.applicationDatabase.topology
156267

157268
*Type*: string

0 commit comments

Comments
 (0)