[DOCS-10923] db.setLogLevel Created: 20/Oct/17  Updated: 27/Oct/23  Resolved: 03/Nov/17

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Docs Collector User (Inactive) Assignee: Stennie Steneker (Inactive)
Resolution: Works as Designed Votes: 0
Labels: mts
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mongodb , docker container v 3.4

Location: https://docs.mongodb.com/manual/reference/method/db.setLogLevel/
Referrer: https://www.google.se/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
Screen Resolution: 1680 x 1050


Participants:
Days since reply: 6 years, 14 weeks, 5 days ago

 Description   

Im trying to update log settings on a running DB through the JS file

db.setLogLevel(0);
db.setLogLevel(1, 'accessControl');
db.setLogLevel(0, 'command');
db.setLogLevel(1, 'control');
db.setLogLevel(0, 'ftdc');
db.setLogLevel(0, 'geo');
db.setLogLevel(0, 'index');
db.setLogLevel(1, 'network');
db.setLogLevel(1, 'network.asio');
db.setLogLevel(0, 'network.bridge');
db.setLogLevel(0, 'query');
db.setLogLevel(3, 'replication');
db.setLogLevel(0, 'sharding');
db.setLogLevel(0, 'storage');
db.setLogLevel(0, 'storage.journal');
db.setLogLevel(0, 'tracking');
db.setLogLevel(0, 'write');
db.setLogLevel(0, '-');

If i give any other values than 0 or 1 in these commands, i get what feels like the full debug log.
As an example, with this config

 db.getLogComponents()
{
	"verbosity" : 0,
.....
	"replication" : {
		"verbosity" : 3
	},

I am getting this REPL log

gg-mongo_1          | 2017-10-20T10:31:25.802+0000 D REPL     [replication-1] Reporter sending slave oplog progress to upstream updater 192.168.33.33:27017: { replSetUpdatePosition: 1, optimes: [ { durableOpTime: { ts: Timestamp 1508492498000|3, t: 20 }, appliedOpTime: { ts: Timestamp 1508492498000|3, t: 20 }, memberId: 0, cfgver: 12 }, { durableOpTime: { ts: Timestamp 1508495480000|1, t: 21 }, appliedOpTime: { ts: Timestamp 1508495480000|1, t: 21 }, memberId: 1, cfgver: 12 }, { durableOpTime: { ts: Timestamp 1508495480000|1, t: 21 }, appliedOpTime: { ts: Timestamp 1508495480000|1, t: 21 }, memberId: 2, cfgver: 12 }, { durableOpTime: { ts: Timestamp 0|0, t: -1 }, appliedOpTime: { ts: Timestamp 1508495480000|1, t: 21 }, memberId: 3, cfgver: 12 } ], $replData: { term: 21, lastOpCommitted: { ts: Timestamp 1508495480000|1, t: 21 }, lastOpVisible: { ts: Timestamp 0|0, t: -1 }, configVersion: 12, replicaSetId: ObjectId('59e9ab765f33763b41eb2637'), primaryIndex: 0, syncSourceIndex: 0 } }

That looks like a Debug log to me..



 Comments   
Comment by Stennie Steneker (Inactive) [ 03/Nov/17 ]

> That looks like a Debug log to me..

This is working as documented for db.setLogLevel():

1 to 5 increases the verbosity level to include Debug messages.

Regards,
Stennie

Generated at Thu Feb 08 08:01:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.