[SERVER-14729] Add log component to non-debug messages Created: 30/Jul/14  Updated: 14/Oct/15  Resolved: 12/Aug/14

Status: Closed
Project: Core Server
Component/s: Logging
Affects Version/s: 2.7.4
Fix Version/s: 2.7.5

Type: New Feature Priority: Minor - P4
Reporter: Benety Goh Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: polish
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-14965 assign accessControl log component to... Closed
is depended on by SERVER-15380 Finish assigning default log componen... Closed
Related
related to SERVER-14894 modify S2 debug log message about int... Closed
is related to SERVER-5092 Better named logging with tracing Closed
is related to DOCS-3694 Document named logging Closed
is related to SERVER-85138 guide for log messages and debug levels Closed
is related to SERVER-4217 add log severity and component name t... Closed
Tested
Participants:

 Description   

Currently only debug log messages are written with the log component name. It would be useful to log the component name for severities other than DEBUG(N).

These macros should use the log component declared at the top of the file using the macro:

#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kMyComponent

Example:

2014-08-12T13:05:49.142-0400 D COMMANDS [conn4] run command admin.$cmd { _isSelf: 1 }
2014-08-12T13:05:49.142-0400 I QUERY    [conn4] command admin.$cmd command: _isSelf { _isSelf: 1 } ntoreturn:1 keyUpdates:0 numYields:0  reslen:53 0ms
2014-08-12T13:05:49.142-0400 I REPLSETS [rsStart] replSet load config ok from benetymbp.local:31100
2014-08-12T13:05:49.142-0400 D NETWORK  [conn4] Socket recv() conn closed? 10.4.112.255:63280

A secondary goal would be to disallow the use of mongo/util/log.h in headers.



 Comments   
Comment by Githook User [ 22/Sep/14 ]

Author:

{u'username': u'hawka', u'name': u'Amalia Hawkins', u'email': u'amalia.hawkins@10gen.com'}

Message: SERVER-14729 assign default log component MONGO_LOG_DEFAULT_COMPONENT
Branch: master
https://github.com/mongodb/mongo/commit/61c7055f1f0a01957b54429211e177545a062bc7

Comment by Githook User [ 14/Aug/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-14729 assign default log component MONGO_LOG_DEFAULT_COMPONENT
Branch: master
https://github.com/mongodb/mongo/commit/10827279fbc6380d4d7774837022b65b3204a988

Comment by Githook User [ 12/Aug/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-14729 disallow multiple inclusion of mongo/util/log.h
Branch: master
https://github.com/mongodb/mongo/commit/7fb648f261973a7002d88e8405fc1e4661d0fbdd

Comment by Githook User [ 12/Aug/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-14729 removed MONGO_LOG_DEFAULT_COMPONENT_FILE and MONGO_LOG_DEFAULT_COMPONENT_LOCAL macros
Branch: master
https://github.com/mongodb/mongo/commit/2644f32bc3e8aa2f0c68ad19b93ebb0b681471c1

Comment by Githook User [ 12/Aug/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-14729 assign default log component MONGO_LOG_DEFAULT_COMPONENT
Branch: master
https://github.com/mongodb/mongo/commit/8a523f3bfd6e32cb6882d38e4eeff6adb6ea27c1

Comment by Githook User [ 12/Aug/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-14729 support overriding of default log component in unconditional log functions severe(), error(), warning() and log()
Branch: master
https://github.com/mongodb/mongo/commit/850d2d0912e519e544f0c896583a6fbd5cceabce

Comment by Githook User [ 12/Aug/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-14729 logging cleanup - removed mongo/util/log.h from headers, de-inlining functions that use logging where applicable.

de-inlined BSONElement::_asCode()
de-inlined BSONObjBuilder::appendDate()
de-inlined DBClientCursor::nextSafe()
de-inlined IndexDescriptor::_checkOk()
de-inlined LastErrorHolder::getSafe()
de-inlined UpdateResult constructor
de-inlined QueryPlannerCommon::reverseScans()
de-inlined repl::ScopedConn::connect()
de-inlined repl::_MultiCommand::run()
de-inlined OplogReader::tailCheck()
de-inlined repl::StateBox::change()
de-inlined repl::SyncSourceFeedback::_resetConnection()
de-inlined DiskLoc56Bit::operator=()
de-inlined DurableInterface::~DurableInterface()
de-inlined ListeningSockets::closeAll()
de-inlined RelativePath::fromFullPath() and getPartition()
de-inlined V8Scope::checkV8ErrorState and removed debug log message from ObjTracker destructor
(v8-3.25) de-inlined V8Scope::checkV8ErrorState and removed debug log message from ObjTracker destructor
removed log message from List1::orphan() - this should have no user-facing impact because List1::orphan() is used in tests only
removed log message from RWLockRecursiveNongreedy::Lock()
removed log message from RSBase destructor
removed log.h dependency from DESTRUCTOR_GUARD macro
removed mongo/util/log.h dependency from qlog.h
removed mongo/util/log.h dependency from stacktrace.h
removed mongo/util/log.h dependency from s2 logging header
removed mongo/util/log.h dependency from chunk_diff-inl.cpp
removed mongo/util/log.h from pch.h
removed unused mongo/util/log.h include from inlined file sorter.cpp
convert HashTable<K,V> to non-template NamespaceHashTable. De-inlined NamespaceHashTable::_find() and constructor
convert isself getMyAddrs()and getallIPs() debug log to use LOG() macro
assign default log component MONGO_LOG_DEFAULT_COMPONENT
removed unused macros LOGATMOST and LOGSOME
removed unused FLOG() macro from goodies.h
Branch: master
https://github.com/mongodb/mongo/commit/a3845092f26955e6cbfca868fd136b7d5eefed9b

Comment by Githook User [ 08/Aug/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-14729 de-inlined fassertStatusOK(). ensure util/log.h is included in every implementation file that uses logging
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/88240f27ccc05b1867fd7f9f6457bf92a82939a4

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