Skip to content

Commit 1f4d559

Browse files
DOCSP-48000-log-compression (#386)
* DOCSP-48000-log-compression * edits * clarify restart behavior * add cross link
1 parent 51f2d9c commit 1f4d559

File tree

4 files changed

+86
-3
lines changed

4 files changed

+86
-3
lines changed

source/includes/list-table-shell-properties.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@
5757
- The depth to which objects are printed. Setting ``inspectDepth``
5858
to ``Infinity`` (the javascript object) prints all nested
5959
objects to their full depth.
60+
61+
* - ``logCompressionEnabled``
62+
- boolean
63+
- false
64+
- Specifies whether |mdb-shell| compresses log files. When this
65+
value is ``true``, |mdb-shell| uses gzip to compress logs. See
66+
:ref:`mongosh-log-compression`.
6067

6168
* - ``logLocation``
6269
- string

source/logs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,4 @@ automatically deletes log files older than 30 days.
7272
Disable Logging </logs/disable>
7373
Specify Log Location <logs/location>
7474
Write Custom Log Entries <logs/custom-entries>
75+
Enable Log Compression </logs/compression>

source/logs/compression.txt

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
.. _mongosh-log-compression:
2+
3+
======================
4+
Enable Log Compression
5+
======================
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
You can enable compression for |mdb-shell| log files. By default,
14+
|mdb-shell| does not compress log files.
15+
16+
About this Task
17+
---------------
18+
19+
When log compression is enabled, |mdb-shell| compresses log files with
20+
gzip.
21+
22+
After you toggle log compression, you must start a new |mdb-shell|
23+
session for the change to take effect.
24+
25+
Before you Begin
26+
----------------
27+
28+
To check if log compression is enabled, run the following command from
29+
|mdb-shell|:
30+
31+
.. code-block:: javascript
32+
33+
config.get("logCompressionEnabled")
34+
35+
Steps
36+
-----
37+
38+
To enable log compression, set the ``logCompressionEnabled``
39+
configuration option to ``true``. You can set configuration options in
40+
the :ref:`configuration API <configure-settings-api>` or a
41+
:ref:`configuration file <configure-settings-global>`.
42+
43+
Enable Log Compression with the Configuration API
44+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45+
46+
The following command uses the config API to enable log compression:
47+
48+
.. io-code-block::
49+
:copyable: true
50+
51+
.. input::
52+
:language: javascript
53+
54+
config.set("logCompressionEnabled", true)
55+
56+
.. output::
57+
:language: javascript
58+
59+
Setting "logCompressionEnabled" has been changed
60+
61+
Enable Log Compression with a Configuration File
62+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63+
64+
The following configuration file enables log compression:
65+
66+
.. code-block:: yaml
67+
68+
mongosh:
69+
logCompressionEnabled: true
70+
71+
Disable Log Compression
72+
~~~~~~~~~~~~~~~~~~~~~~~
73+
74+
To disable log compression, set ``logCompressionEnabled`` to ``false``.
75+
You can perform this action through the config API or configuration
76+
file.

source/logs/location.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ To view the current log file location, use the :ref:`config API
3434

3535
config.get("logLocation")
3636

37-
After you modify your log file location, your current MongoDB Shell
38-
session continues to use the previous log file location. Sessions that
39-
start after you change the log file location use the updated location.
37+
After you modify your log file location, you must start a new
38+
|mdb-shell| session for the change to take effect.
4039

4140
Log File Names
4241
~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)