Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-13069

newline characters in balancer log messages when acquiring distributed lock

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.6.0-rc2
    • Affects Version/s: 2.6.0-rc0
    • Component/s: Logging, Usability
    • None

      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?

            Assignee:
            greg_10gen Greg Studer
            Reporter:
            thomas.rueckstiess@mongodb.com Thomas Rueckstiess
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: