[SERVER-47031] V2 logging should log Timestamp objects with their toString Created: 20/Mar/20  Updated: 27/Oct/23  Resolved: 23/Mar/20

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

Type: Improvement Priority: Major - P3
Reporter: Daniel Gottlieb (Inactive) Assignee: Backlog - Storage Execution Team
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Storage Execution
Participants:

 Description   

Current output is in extended json format:

"Stable Timestamp":{"$timestamp":{"t":0,"i":0}}

Proposed toString:

"Stable Timestamp":"Timestamp(0, 0)"



 Comments   
Comment by Andy Schwerin [ 23/Mar/20 ]

The current form is by design, for parsing by systems that support parsing extended json v2. ejv2 does leave something to be desired with regards to conciseness, but I'm afraid we'll need to address that either by adjustments to the spec or by changing the tools we use to render the logs.

Comment by Daniel Gottlieb (Inactive) [ 21/Mar/20 ]

Maybe. I guess I noticed this because structured logging didn't affect WT logs, which prints timestamps in `(time, inc)` format:

{"t":{"$date":"2020-03-21T10:49:17.679-04:00"},"s":"I", "c":"STORAGE", "id":22430,"ctx":"initandlisten","msg":"WiredTiger message","attr":{"message":"[1584802157:678961][11898:0x7fa2007bfa80], txn-recover: Set global recovery timestamp: (0, 0)"}}

which is often compared to logs of the stable timestamp.

Though if we weren't to do this, I'd push for doing this translation in lobster

Comment by Bruce Lucas (Inactive) [ 21/Mar/20 ]

Isn't the current format preferable because it is readily machine readable, consistent with the goals of structured logging?

Generated at Thu Feb 08 05:13:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.