[SERVER-10101] Make log files more machine-parsable Created: 05/Jul/13  Updated: 11/Jul/16  Resolved: 27/Aug/13

Status: Closed
Project: Core Server
Component/s: Logging
Affects Version/s: None
Fix Version/s: 2.5.2

Type: Improvement Priority: Minor - P4
Reporter: Thomas Rueckstiess Assignee: Unassigned
Resolution: Done Votes: 0
Labels: pull-request
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-5092 Better named logging with tracing Closed
Backwards Compatibility: Minor Change
Participants:

 Description   

Currently it is hard to automatically parse mongod and mongos logfiles due to little inconsistencies and ambiguities that can easily be fixed.

numYields

Wed Sep 05 18:17:35 [conn106842] getmore test.docs query: { ps: 3 } cursorid:77621193264928 ntoreturn:0 keyUpdates:0 numYields: 7 locks(micros) r:12009 nreturned:1044 reslen:2628447 15ms

Most counters like ntoreturn:1, nreturned:1, ... have no space after the colon, but numYields: 1 does have a space after the colon, making its value a separate token when splitting the line on spaces. Please remove the space after numYields:.

Space before "ms"

Most timed operations print their duration as ###ms (#=digit). Some, however, have a space before the ms.

Wed Sep 05 18:56:05 [DataFileSync] FlushViewOfFile for F:/data/local.3 failed with error 1 after 1 attempts taking 933 ms

Please remove the space. As this is a counter like the ones above, it would also make sense to replace this with duration:### instead for consistency.

read/write lock syntax

The read and write lock microsecond numbers currently have this syntax:

Wed Jun 19 13:48:13.454 [conn2] insert test.docs ninserted:1 keyUpdates:0 locks(micros) w:231001 230ms

The w: is ambiguous with for example the getlasterror command with write concern. The actual indicator locks(micros) is a separate and not very useful token.

Suggestion: remove the locks(micros) and rename the actual w: and r: labels to wlock: and rlock:.

Server Restarted

  
  
  
***** SERVER RESTARTED *****
  
  

Instead of the two empty lines before and after the server restarted messages, it should be in one single line, with a date and time like all the other lines.

These are trivial changes but would be very useful for machine parsing.



 Comments   
Comment by Matt Kangas [ 27/Aug/13 ]

Whitespace changes shipped in 2.5.2.

Remaining changes ("duration:###", change "w:" to "wlock", etc) were vetoed by Eliot.

Comment by Matt Kangas [ 02/Aug/13 ]

Whitespace issues resolved & merged in 07faf6e.

The syntactic changes ("duration:", "wlock:", etc) are less likely to be approved, will address when Thomas is in NYC next week.

Comment by auto [ 02/Aug/13 ]

Author:

{u'username': u'edaniels', u'name': u'Eric Daniels', u'email': u'eric.daniels@10gen.com'}

Message: SERVER-10101 fixed whitespace issues

Signed-off-by: Matt Kangas <matt.kangas@10gen.com>
Branch: master
https://github.com/mongodb/mongo/commit/07faf6eef1d11d0cf9cff3c527dc98656d8f2a21

Comment by Eric Daniels (Inactive) [ 02/Aug/13 ]

pull request url: https://github.com/mongodb/mongo/pull/469 this is for the spaces fix

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