[SERVER-16755] Global severity seems to overwrite component severity in some cases Created: 07/Jan/15  Updated: 15/Jan/15  Resolved: 08/Jan/15

Status: Closed
Project: Core Server
Component/s: Logging
Affects Version/s: 2.8.0-rc4
Fix Version/s: 2.8.0-rc5

Type: Bug Priority: Major - P3
Reporter: Thomas Rueckstiess Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-16753 Wrong component for commands Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:
Participants:

 Description   

When setting the QUERY component log level to 1, I would expect to see all QUERY messages that I would normally see at global log level 1. This doesn't seem to be the case.

1. run mongod 2.8.0-rc4
2. insert doc in collection: db.foo.insert({a: 1})
3. set QUERY component log level to 1: db.setLogLevel(1, "query")
4. make a query: db.foo.find({a: 1})

The query does not show up in the log.

Is my expectation wrong? I would expect this line to be logged:

2015-01-07T22:37:20.706+1100 I QUERY    [conn3] query test.foo query: { a: 1.0 } planSummary: COLLSCAN ntoreturn:0 ntoskip:0 nscanned:0 nscannedObjects:1 keyUpdates:0 numYields:0  nreturned:1 reslen:53 0ms

But I only see this line when I increase the global log level to 1, with

db.setLogLevel(1)

or any of the other means, e.g. "mongod -v" or the setParameter command.



 Comments   
Comment by Githook User [ 08/Jan/15 ]

Author:

{u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-16755 SERVER-16753 improvements to query logging
Branch: master
https://github.com/mongodb/mongo/commit/a509c387938bb8aef9a0254fcb464e25e90cbd24

Comment by Eric Milkie [ 07/Jan/15 ]

For this particular log line, which has some complicated logic to determine if it should appear, it ignores the state of the "logComponentForOp", which can be QUERY or WRITE. Also, the logic is different for write commands versus wire-protocol writes. We should fix this for 2.8.

Generated at Thu Feb 08 03:42:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.