[SERVER-13069] newline characters in balancer log messages when acquiring distributed lock Created: 06/Mar/14  Updated: 11/Jul/16  Resolved: 10/Mar/14

Status: Closed
Project: Core Server
Component/s: Logging, Usability
Affects Version/s: 2.6.0-rc0
Fix Version/s: 2.6.0-rc2

Type: Improvement Priority: Minor - P4
Reporter: Thomas Rueckstiess Assignee: Greg Studer
Resolution: Done Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

In src/mongo/s/distlock.cpp:859:

The log messages for acquiring a distributed log on LogLevel 1 contain newline characters, thus inserting many lines in the log file that do not start with a date.

2014-03-06T13:11:36.421+1100 [Balancer] about to acquire distributed lock 'balancer/enter.local:27017:1394071745:16807:
{ "state" : 1,
  "who" : "enter.local:27017:1394071745:16807:Balancer:1622650073",
  "process" : "enter.local:27017:1394071745:16807",
  "when" : { "$date" : "2014-03-06T13:11:36.421+1100" },
  "why" : "doing balance round",
  "ts" : { "$oid" : "5317d95853d2a04cf55266ce" } }
{ "_id" : "balancer",
  "state" : 0,
  "ts" : { "$oid" : "5317d95253d2a04cf55266cd" } }
2014-03-06T13:11:36.422+1100 [Balancer] distributed lock 'balancer/enter.local:27017:1394071745:16807' acquired, ts : 5317d95853d2a04cf55266ce

This makes automatic log parsing difficult and should be avoided.

Can we remove the newline characters from these messages and print the entire json string in the single line, consistent with other log messages?



 Comments   
Comment by Githook User [ 10/Mar/14 ]

Author:

{u'username': u'gregstuder', u'name': u'Greg Studer', u'email': u'greg@10gen.com'}

Message: SERVER-13069 nicer and slightly less verbose distributed lock messages
Branch: master
https://github.com/mongodb/mongo/commit/cc421d9723c67f0afa3efacc7ff4c766aceea332

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