@@ -31,7 +31,8 @@ The command has the following syntax:
31
31
32
32
db.adminCommand(
33
33
{
34
- logRotate: <target>
34
+ logRotate: <integer or string>,
35
+ comment: <string>
35
36
}
36
37
)
37
38
@@ -44,21 +45,21 @@ The command takes the following fields:
44
45
:header-rows: 1
45
46
:widths: 20 20 80
46
47
47
- * - Parameter
48
+ * - Field
48
49
- Type
49
50
- Description
50
51
51
- * - ``<target> ``
52
- - string
52
+ * - ``logRotate ``
53
+ - integer or string
53
54
- The log or logs to rotate, according to the following:
54
55
55
56
- ``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
58
59
59
60
* - ``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
62
63
audit file at time of log rotation.
63
64
64
65
You may also rotate the logs by sending a ``SIGUSR1`` signal to the
@@ -116,11 +117,11 @@ The following example rotates both the server log and the audit log:
116
117
117
118
.. code-block:: javascript
118
119
119
- db.adminCommand({ logRotate: 1} )
120
+ db.adminCommand( { logRotate: 1 } )
120
121
121
122
The following example rotates only the audit log, and provides a custom
122
123
message to the log file at time of rotation:
123
124
124
125
.. code-block:: javascript
125
126
126
- db.adminCommand({ logRotate: audit, comment: "Rotating audit log"} )
127
+ db.adminCommand( { logRotate: " audit" , comment: "Rotating audit log" } )
0 commit comments