Skip to content

Commit 3abe1c1

Browse files
jason-price-mongodbjason-price-mongodb
andauthored
DOCSP-33410-log-rotation (#5004) (#5023)
* DOCSP-33410-log-rotation * DOCSP-33410-log-rotation * DOCSP-33410-log-rotation * DOCSP-33410-log-rotation * DOCSP-33410-log-rotation * DOCSP-33410-log-rotation --------- Co-authored-by: jason-price-mongodb <[email protected]>
1 parent 65e3eb2 commit 3abe1c1

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

source/reference/command/logRotate.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ The command has the following syntax:
3131

3232
db.adminCommand(
3333
{
34-
logRotate: <target>
34+
logRotate: <integer or string>,
35+
comment: <string>
3536
}
3637
)
3738

@@ -44,21 +45,21 @@ The command takes the following fields:
4445
:header-rows: 1
4546
:widths: 20 20 80
4647

47-
* - Parameter
48+
* - Field
4849
- Type
4950
- Description
5051

51-
* - ``<target>``
52-
- string
52+
* - ``logRotate``
53+
- integer or string
5354
- The log or logs to rotate, according to the following:
5455

5556
- ``1`` -- Rotates both the server and audit logs
56-
- ``server`` -- Rotates only the server log
57-
- ``audit`` -- Rotates only the audit log
57+
- ``"server"`` -- Rotates only the server log
58+
- ``"audit"`` -- Rotates only the audit log
5859

5960
* - ``comment``
60-
- any
61-
- *optional* A message logged by the server to the log file and
61+
- string
62+
- *Optional.* A message logged by the server to the log file and
6263
audit file at time of log rotation.
6364

6465
You may also rotate the logs by sending a ``SIGUSR1`` signal to the
@@ -117,11 +118,11 @@ The following example rotates both the server log and the audit log:
117118

118119
.. code-block:: javascript
119120

120-
db.adminCommand({logRotate: 1})
121+
db.adminCommand( { logRotate: 1 } )
121122

122123
The following example rotates only the audit log, and provides a custom
123124
message to the log file at time of rotation:
124125

125126
.. code-block:: javascript
126127

127-
db.adminCommand({logRotate: audit, comment: "Rotating audit log"})
128+
db.adminCommand( { logRotate: "audit", comment: "Rotating audit log" } )

0 commit comments

Comments
 (0)