You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not opposed to standardizing, I think that's a good plan. However, I think the messages array is useful when there are multiple messages to have a structured way to extract them back out. I'd welcome a PR to provide some standardization.
For the message: in my experience, logging tools (which parses the json) expect a single message. I haven't yet come across a usecase where we wanted to put a list of messages for a particular log. Generally, we're going to rely on the stacktrace or the MDC if we want to get something structured out.
But if necessary, I think we can either output 2 properties (1 unique grouped string and 1 for the array), or provide options on which json formatting to choose.
There are output differences between the 2 options for logging JSON.
These differences include different property names and output type : messages vs message and list(string) vs string for example.
Sources:
https://github.com/outr/scribe/blob/master/jsonFabric/shared/src/main/scala/scribe/json/ScribeFabricJsonSupport.scala#L38
https://github.com/outr/scribe/blob/master/jsonCirce/shared/src/main/scala/scribe/json/ScribeCirceJsonSupport.scala#L23
I propose to standardize around this format (which I think is fairly common):
What do you think?
The text was updated successfully, but these errors were encountered: