Skip to content

Commit 640c9b4

Browse files
authored
DOCSP-38154 Add Additional getLog Commands (#7305) (#7369)
* DOCSP-38154 Add Additional getLog Commands * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
1 parent 827f71f commit 640c9b4

File tree

1 file changed

+194
-4
lines changed

1 file changed

+194
-4
lines changed

source/reference/method/db.setLogLevel.txt

Lines changed: 194 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
================
23
db.setLogLevel()
34
================
@@ -91,9 +92,89 @@ Omit the ``<component>`` parameter to set the default verbosity for all
9192
components; i.e. the :setting:`systemLog.verbosity` setting. The
9293
operation sets the default verbosity to ``1``:
9394

94-
.. code-block:: javascript
95+
.. io-code-block::
96+
:copyable: true
97+
98+
.. input::
99+
:language: javascript
100+
101+
db.setLogLevel(1)
95102

96-
db.setLogLevel(1)
103+
.. output::
104+
:language: javascript
105+
:visible: false
106+
107+
{
108+
was: {
109+
verbosity: 1,
110+
accessControl: { verbosity: -1 },
111+
assert: { verbosity: -1 },
112+
command: { verbosity: -1 },
113+
control: { verbosity: -1 },
114+
executor: { verbosity: -1 },
115+
geo: { verbosity: -1 },
116+
globalIndex: { verbosity: -1 },
117+
index: { verbosity: -1 },
118+
network: {
119+
verbosity: -1,
120+
asio: { verbosity: -1 },
121+
bridge: { verbosity: -1 },
122+
connectionPool: { verbosity: -1 }
123+
},
124+
processHealth: { verbosity: -1 },
125+
query: {
126+
verbosity: -1,
127+
optimizer: { verbosity: -1 },
128+
ce: { verbosity: -1 }
129+
},
130+
queryStats: { verbosity: -1 },
131+
replication: {
132+
verbosity: -1,
133+
election: { verbosity: -1 },
134+
heartbeats: { verbosity: -1 },
135+
initialSync: { verbosity: -1 },
136+
rollback: { verbosity: -1 }
137+
},
138+
sharding: {
139+
verbosity: -1,
140+
rangeDeleter: { verbosity: -1 },
141+
shardingCatalogRefresh: { verbosity: -1 },
142+
migration: { verbosity: -1 },
143+
reshard: { verbosity: -1 },
144+
migrationPerf: { verbosity: -1 }
145+
},
146+
storage: {
147+
verbosity: -1,
148+
recovery: { verbosity: -1 },
149+
journal: { verbosity: 2 },
150+
wt: {
151+
verbosity: -1,
152+
wtBackup: { verbosity: -1 },
153+
wtCheckpoint: { verbosity: -1 },
154+
wtCompact: { verbosity: -1 },
155+
wtEviction: { verbosity: -1 },
156+
wtHS: { verbosity: -1 },
157+
wtRecovery: { verbosity: -1 },
158+
wtRTS: { verbosity: -1 },
159+
wtSalvage: { verbosity: -1 },
160+
wtTiered: { verbosity: -1 },
161+
wtTimestamp: { verbosity: -1 },
162+
wtTransaction: { verbosity: -1 },
163+
wtVerify: { verbosity: -1 },
164+
wtWriteLog: { verbosity: -1 }
165+
}
166+
},
167+
write: { verbosity: -1 },
168+
ftdc: { verbosity: -1 },
169+
tracking: { verbosity: -1 },
170+
transaction: { verbosity: -1 },
171+
tenantMigration: { verbosity: -1 },
172+
test: { verbosity: -1 },
173+
resourceConsumption: { verbosity: -1 },
174+
streams: { verbosity: -1 }
175+
},
176+
ok: 1
177+
}
97178

98179
Set Verbosity Level for a Component
99180
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -102,6 +183,115 @@ Specify the ``<component>`` parameter to set the verbosity for the
102183
component. The following operation updates the
103184
:setting:`systemLog.component.storage.journal.verbosity` to ``2``:
104185

105-
.. code-block:: javascript
186+
.. io-code-block::
187+
:copyable: true
188+
189+
.. input::
190+
:language: javascript
191+
192+
db.setLogLevel(2, "storage.journal" )
193+
194+
.. output::
195+
:language: javascript
196+
:visible: false
197+
198+
{
199+
was: {
200+
verbosity: 1,
201+
accessControl: { verbosity: -1 },
202+
assert: { verbosity: -1 },
203+
command: { verbosity: -1 },
204+
control: { verbosity: -1 },
205+
executor: { verbosity: -1 },
206+
geo: { verbosity: -1 },
207+
globalIndex: { verbosity: -1 },
208+
index: { verbosity: -1 },
209+
network: {
210+
verbosity: -1,
211+
asio: { verbosity: -1 },
212+
bridge: { verbosity: -1 },
213+
connectionPool: { verbosity: -1 }
214+
},
215+
processHealth: { verbosity: -1 },
216+
query: {
217+
verbosity: -1,
218+
optimizer: { verbosity: -1 },
219+
ce: { verbosity: -1 }
220+
},
221+
queryStats: { verbosity: -1 },
222+
replication: {
223+
verbosity: -1,
224+
election: { verbosity: -1 },
225+
heartbeats: { verbosity: -1 },
226+
initialSync: { verbosity: -1 },
227+
rollback: { verbosity: -1 }
228+
},
229+
sharding: {
230+
verbosity: -1,
231+
rangeDeleter: { verbosity: -1 },
232+
shardingCatalogRefresh: { verbosity: -1 },
233+
migration: { verbosity: -1 },
234+
reshard: { verbosity: -1 },
235+
migrationPerf: { verbosity: -1 }
236+
},
237+
storage: {
238+
verbosity: -1,
239+
recovery: { verbosity: -1 },
240+
journal: { verbosity: -1 },
241+
wt: {
242+
verbosity: -1,
243+
wtBackup: { verbosity: -1 },
244+
wtCheckpoint: { verbosity: -1 },
245+
wtCompact: { verbosity: -1 },
246+
wtEviction: { verbosity: -1 },
247+
wtHS: { verbosity: -1 },
248+
wtRecovery: { verbosity: -1 },
249+
wtRTS: { verbosity: -1 },
250+
wtSalvage: { verbosity: -1 },
251+
wtTiered: { verbosity: -1 },
252+
wtTimestamp: { verbosity: -1 },
253+
wtTransaction: { verbosity: -1 },
254+
wtVerify: { verbosity: -1 },
255+
wtWriteLog: { verbosity: -1 }
256+
}
257+
},
258+
write: { verbosity: -1 },
259+
ftdc: { verbosity: -1 },
260+
tracking: { verbosity: -1 },
261+
transaction: { verbosity: -1 },
262+
tenantMigration: { verbosity: -1 },
263+
test: { verbosity: -1 },
264+
resourceConsumption: { verbosity: -1 },
265+
streams: { verbosity: -1 }
266+
},
267+
ok: 1
268+
}
269+
270+
Get Global Log Level For a Deployment
271+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
272+
273+
The following operation gets the default logging level verbosity for a
274+
deployment:
275+
276+
.. io-code-block::
277+
:copyable: true
278+
279+
.. input::
280+
:language: javascript
281+
282+
db.adminCommand({getParameter: 1, logLevel: 1});
283+
284+
.. output::
285+
:language: javascript
286+
:emphasize-lines: 2
287+
:visible: false
288+
289+
{
290+
logLevel: 0,
291+
ok: 1
292+
}
293+
294+
.. note::
106295

107-
db.setLogLevel(2, "storage.journal" )
296+
You can also get log verbosity levels for MongoDB components.
297+
For details, see :method:`db.getLogComponents()`.

0 commit comments

Comments
 (0)