From da8426156b64e9491b6d758aac86a1ae625eef17 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Mon, 17 Sep 2012 13:22:16 -0400 Subject: [PATCH 1/3] DOCS-46 document logRotate better --- source/reference/command/logRotate.txt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/source/reference/command/logRotate.txt b/source/reference/command/logRotate.txt index b85b5951bf8..61ac3548107 100644 --- a/source/reference/command/logRotate.txt +++ b/source/reference/command/logRotate.txt @@ -6,9 +6,8 @@ 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: :: { logRotate: 1 } @@ -24,9 +23,15 @@ logRotate kill -SIGUSR1 2200 - The rotated files will have a timestamp appended to the filename. + The rotated files will have a timestamp of the form ``YYYY-MM-DD``\T ``HH-MM-SS`` + appended to the filename. + .. 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 mongod instances + running on Windows systems with MongoDB release 2.0.3 and higher. + +.. 16175 thrown if rotatelogs fails From 195bf9a7085590350bca4b4d2d06dc599538c7e2 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Mon, 17 Sep 2012 13:39:29 -0400 Subject: [PATCH 2/3] DOCS-46 expand a bit on what logRotate does --- source/reference/command/logRotate.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/reference/command/logRotate.txt b/source/reference/command/logRotate.txt index 61ac3548107..68f4e9e8c06 100644 --- a/source/reference/command/logRotate.txt +++ b/source/reference/command/logRotate.txt @@ -23,7 +23,12 @@ logRotate kill -SIGUSR1 2200 - The rotated files will have a timestamp of the form ``YYYY-MM-DD``\T ``HH-MM-SS`` + + :dbcommand:`logRotate` will cause the existing log file to be renamed + by appending the current timestamp to the filename. A new log file will be created + with the name which was specified by the :option:`--logpath` option to :program:`mongod` + or :program:`mongos`. + The rotated files will have a timestamp of the form yyyy-mm-ddThh-mm-ss appended to the filename. From 17d84f6d1787abb301960cf9a7cfcac092d8251f Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Mon, 17 Sep 2012 15:16:21 -0400 Subject: [PATCH 3/3] DOCS-46 incorporate edits and rst formatting from @tycoish --- source/reference/command/logRotate.txt | 38 +++++++++++++++----------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/source/reference/command/logRotate.txt b/source/reference/command/logRotate.txt index 68f4e9e8c06..7634c3922d1 100644 --- a/source/reference/command/logRotate.txt +++ b/source/reference/command/logRotate.txt @@ -6,8 +6,11 @@ logRotate .. dbcommand:: logRotate - :dbcommand:`logRotate` is an :term:`admin database` command that allows you to rotate - the MongoDB logs. 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 } @@ -16,27 +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 - - :dbcommand:`logRotate` will cause the existing log file to be renamed - by appending the current timestamp to the filename. A new log file will be created - with the name which was specified by the :option:`--logpath` option to :program:`mongod` - or :program:`mongos`. - The rotated files will have a timestamp of the form yyyy-mm-ddThh-mm-ss + :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:: - .. versionadded::2.0.3 - - The :dbcommand:`logRotate` command is available to mongod instances - running on Windows systems with MongoDB release 2.0.3 and higher. + .. 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. -.. 16175 thrown if rotatelogs fails +.. :error:`16175` is thrown if logRotate fails