-
Notifications
You must be signed in to change notification settings - Fork 59
DOCSP-47980-log-storage-size #387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 21 commits
a7c0e11
7af6a87
6d28fe4
67cb087
07bd49b
c7d69a9
27f1fc7
5a37429
1edfd55
18663f2
b06fe68
b1a0999
0181e39
c8960b4
4cc12c8
39c19fc
fdcec4a
aab0c32
42e287d
d60cfa2
3337592
b1e3144
c9d7d59
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.. important:: | ||
|
||
To prevent log storage from growing too large, always specify at | ||
least one log retention criterion. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
.. _mongosh-log-retention-gb: | ||
|
||
=============================== | ||
Modify Maximum Log Storage Size | ||
=============================== | ||
|
||
.. contents:: On this page | ||
:local: | ||
:backlinks: none | ||
:depth: 1 | ||
:class: singlecol | ||
|
||
You can specify a maximum combined storage size for |mdb-shell| log | ||
files. If the total size of all log files exceeds the maximum, log files | ||
are deleted until the combined size is below the threshold, starting | ||
with the oldest log files. By default, there is no maximum log storage | ||
size. | ||
|
||
About this Task | ||
--------------- | ||
|
||
To specify a maximum log storage size, set the ``logRetentionGB`` | ||
configuration option. ``logRetentionGB`` can be any positive float | ||
value (including less than ``1``). | ||
|
||
.. include:: /includes/log-retention-multiple-criteria.rst | ||
|
||
To check the current storage size of log files, check the size of the | ||
log folder. To see the current log folder, run the following command | ||
from |mdb-shell|: | ||
|
||
.. code-block:: javascript | ||
|
||
config.get('logLocation') | ||
|
||
Before you Begin | ||
---------------- | ||
|
||
To check the current maximum log storage size, run the following | ||
command: | ||
|
||
.. code-block:: javascript | ||
|
||
config.get("logRetentionGB") | ||
|
||
Steps | ||
----- | ||
|
||
To modify maximum log storage size, set the ``logRetentionGB`` | ||
configuration option. You can set configuration options in the | ||
:ref:`configuration API <configure-settings-api>` or a | ||
:ref:`configuration file <configure-settings-global>`. | ||
|
||
Modify Maximum Log Storage Size with the API | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The following command uses the config API to set the maximum log storage | ||
size to 3.5 GB: | ||
|
||
.. io-code-block:: | ||
:copyable: true | ||
|
||
.. input:: | ||
:language: javascript | ||
|
||
config.set("logRetentionGB", 3.5) | ||
|
||
.. output:: | ||
:language: javascript | ||
|
||
Setting "logRetentionGB" has been changed | ||
|
||
Modify Maximum Log Storage Size with a Configuration File | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The following configuration file sets the maximum log storage size to | ||
3.5 GB: | ||
|
||
.. code-block:: yaml | ||
|
||
mongosh: | ||
logRetentionGB: 3.5 | ||
|
||
Disable Maximum Log Storage Size | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
To instruct |mdb-shell| to not delete logs based on storage size, set | ||
``logRetentionGB`` to ``Infinity``. You can perform this action through | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's good to leave it like this just fyi: it'd be more performant with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. created mongodb-js/devtools-shared#515 to address this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it - Thanks for the context and for filing the ticket. |
||
the config API or configuration file. For example: | ||
|
||
.. code-block:: javascript | ||
|
||
config.set("logRetentionGB", Infinity) | ||
|
||
.. include:: /includes/specify-one-retention-criterion.rst |
Uh oh!
There was an error while loading. Please reload this page.