@@ -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
@@ -117,11 +118,11 @@ The following example rotates both the server log and the audit log:
117
118
118
119
.. code-block:: javascript
119
120
120
- db.adminCommand({ logRotate: 1} )
121
+ db.adminCommand( { logRotate: 1 } )
121
122
122
123
The following example rotates only the audit log, and provides a custom
123
124
message to the log file at time of rotation:
124
125
125
126
.. code-block:: javascript
126
127
127
- db.adminCommand({ logRotate: audit, comment: "Rotating audit log"} )
128
+ db.adminCommand( { logRotate: " audit" , comment: "Rotating audit log" } )
0 commit comments