diff --git a/source/reference/command/logRotate.txt b/source/reference/command/logRotate.txt index b85b5951bf8..7634c3922d1 100644 --- a/source/reference/command/logRotate.txt +++ b/source/reference/command/logRotate.txt @@ -6,9 +6,11 @@ logRotate .. dbcommand:: logRotate - :dbcommand:`logRotate` is an admin only command that allows you to rotate - the MongoDB logs to prevent a single logfile from consuming too - much disk space. Use the following syntax: :: + :dbcommand:`logRotate` is an :term:`admin database` command that + allows you to rotate + the MongoDB logs. Use the following syntax: + + .. code-block:: javascript { logRotate: 1 } @@ -17,16 +19,30 @@ logRotate Your :program:`mongod` instance needs to be running with the :option:`--logpath [file] ` option. - You may also rotate the logs by sending a ``SIGUSR1`` signal to the :program:`mongod` process. - If your :program:`mongod` has a process ID of 2200, here's how to send the signal on Linux: + You may also rotate the logs by sending a ``SIGUSR1`` signal to the + :program:`mongod` process. + If your :program:`mongod` has a process ID of 2200, here's how to + send the signal on Linux: .. code-block:: sh kill -SIGUSR1 2200 - The rotated files will have a timestamp appended to the filename. + :dbcommand:`logRotate` will cause the existing log file to be + renamed by appending the current timestamp to the filename. + The rotated files will have a timestamp of the form + --
T-- + appended to the filename. + A new log file will be created + with the name which was specified by the + :setting:`--logpath` runtime option to :program:`mongod` + or :program:`mongos`. .. note:: - The :dbcommand:`logRotate` command is not available to mongod instances - running on windows systems. + .. versionadded:: 2.0.3 + The :dbcommand:`logRotate` command is available to + :program:`mongod` instances running on Windows systems with + MongoDB release 2.0.3 and higher. + +.. :error:`16175` is thrown if logRotate fails