-
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
Merged
jeff-allen-mongo
merged 23 commits into
mongodb:master
from
jeff-allen-mongo:DOCSP-47980
Mar 5, 2025
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
a7c0e11
DOCSP-47935-log-retention-duration
jeff-allen-mongo 7af6a87
add duration page to toc
jeff-allen-mongo 6d28fe4
WIP
jeff-allen-mongo 67cb087
Merge remote-tracking branch 'refs/remotes/upstream/master' into DOCS…
jeff-allen-mongo 07bd49b
edit
jeff-allen-mongo c7d69a9
edit
jeff-allen-mongo 27f1fc7
wording
jeff-allen-mongo 5a37429
edit
jeff-allen-mongo 1edfd55
edit
jeff-allen-mongo 18663f2
edit
jeff-allen-mongo b06fe68
wording
jeff-allen-mongo b1a0999
retry build
jeff-allen-mongo 0181e39
DOCSP-47935-log-storage-size
jeff-allen-mongo c8960b4
add setting to table
jeff-allen-mongo 4cc12c8
Merge remote-tracking branch 'refs/remotes/upstream/master' into DOCS…
jeff-allen-mongo 39c19fc
wording
jeff-allen-mongo fdcec4a
Merge remote-tracking branch 'refs/remotes/origin/DOCSP-47935' into D…
jeff-allen-mongo aab0c32
Merge remote-tracking branch 'refs/remotes/upstream/master' into DOCS…
jeff-allen-mongo 42e287d
fix conflict
jeff-allen-mongo d60cfa2
edit
jeff-allen-mongo 3337592
add text
jeff-allen-mongo b1e3144
wording
jeff-allen-mongo c9d7d59
Merge remote-tracking branch 'refs/remotes/upstream/master' into DOCS…
jeff-allen-mongo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 the |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 the |mdb-shell| to not delete logs based on storage size, | ||
set ``logRetentionGB`` to ``Infinity``. You can perform this action | ||
through the config API or configuration file. For example: | ||
|
||
.. code-block:: javascript | ||
|
||
config.set("logRetentionGB", Infinity) | ||
|
||
.. include:: /includes/specify-one-retention-criterion.rst |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.