@@ -6,8 +6,11 @@ logRotate
6
6
7
7
.. dbcommand:: logRotate
8
8
9
- :dbcommand:`logRotate` is an :term:`admin database` command that allows you to rotate
10
- the MongoDB logs. Use the following syntax: ::
9
+ :dbcommand:`logRotate` is an :term:`admin database` command that
10
+ allows you to rotate
11
+ the MongoDB logs. Use the following syntax:
12
+
13
+ .. code-block:: javascript
11
14
12
15
{ logRotate: 1 }
13
16
@@ -16,27 +19,30 @@ logRotate
16
19
Your :program:`mongod` instance needs to be running with the
17
20
:option:`--logpath [file] <mongod --logpath>` option.
18
21
19
- You may also rotate the logs by sending a ``SIGUSR1`` signal to the :program:`mongod` process.
20
- If your :program:`mongod` has a process ID of 2200, here's how to send the signal on Linux:
22
+ You may also rotate the logs by sending a ``SIGUSR1`` signal to the
23
+ :program:`mongod` process.
24
+ If your :program:`mongod` has a process ID of 2200, here's how to
25
+ send the signal on Linux:
21
26
22
27
.. code-block:: sh
23
28
24
29
kill -SIGUSR1 2200
25
30
26
-
27
- :dbcommand:`logRotate` will cause the existing log file to be renamed
28
- by appending the current timestamp to the filename. A new log file will be created
29
- with the name which was specified by the :option:`--logpath` option to :program:`mongod`
30
- or :program:`mongos`.
31
- The rotated files will have a timestamp of the form yyyy-mm-ddThh-mm-ss
31
+ :dbcommand:`logRotate` will cause the existing log file to be
32
+ renamed by appending the current timestamp to the filename.
33
+ The rotated files will have a timestamp of the form
34
+ <YYYY>-<mm>-<DD>T<HH>-<MM>-<SS>
32
35
appended to the filename.
33
-
36
+ A new log file will be created
37
+ with the name which was specified by the
38
+ :setting:`--logpath` runtime option to :program:`mongod`
39
+ or :program:`mongos`.
34
40
35
41
.. note::
36
42
37
- .. versionadded::2.0.3
38
-
39
- The :dbcommand:`logRotate` command is available to mongod instances
40
- running on Windows systems with MongoDB release 2.0.3 and higher.
43
+ .. versionadded:: 2.0.3
44
+ The :dbcommand:`logRotate` command is available to
45
+ :program:`mongod` instances running on Windows systems with
46
+ MongoDB release 2.0.3 and higher.
41
47
42
- .. 16175 thrown if rotatelogs fails
48
+ .. :error:` 16175` is thrown if logRotate fails
0 commit comments