seq-tickets icon indicating copy to clipboard operation
seq-tickets copied to clipboard

Event viewer now shows `$type` property, and sorts structured object fields alphabetically (2023.1 change)

Open spointeau opened this issue 11 months ago • 5 comments

Describe the bug in version 2022.1, the property "$type" was not displayed and the property ordering of the json object followed the compact json formatter. In version 2024.1, "$type" is displayed, and json properties are ordered by alphabetical order (a-z)

Expected behavior The old behavior of 2022.1 was good, we were not annoyed by $type and json properties were as serialized, following the class member ordering.

Screenshots image

Environment (please complete the following information):

  • OS: Windows
  • Browser Safari
  • Seq Version [2024.1]
  • Using Docker? No

spointeau avatar Mar 01 '24 20:03 spointeau

Thanks for the heads-up, we'll take a look.

Is the issue a breaking change for you because you rely on consuming the value of the object programmatically? Thanks!

nblumhardt avatar Mar 01 '24 21:03 nblumhardt

Hello @nblumhardt,

This is a breaking change for us (I work with @spointeau) because we rely on a specific order for properties to be read. If Seq sorts these properties alphabetically, it disrupts our workflow.

For instance, when we view EDI x12 messages inside Seq, the sequence of segments doesn't adhere to x12 requirements. As such, we won't be able to use it in the 2024.01 version.

image

thomasarduin avatar Mar 02 '24 02:03 thomasarduin

Thanks for the additional info, @thomasarduin.

I believe the formatter tweak discussed in https://github.com/serilog/serilog-formatting-compact/issues/64 will address the $type issue.

The ordering problem will need some more analysis, we'll update this ticket with our findings.

Best regards, Nick

nblumhardt avatar Mar 04 '24 06:03 nblumhardt

Hi @thomasarduin; thanks for your patience.

Unfortunately this has been a deeply-ingrained change since Seq 2023.1; it's possible we could address this or add a means to work around it in a future update, but because the code involved is performance-sensitive it's not likely this can be reversed in a near-term release.

If you need a precise 1:1 representation of the original object, logging it as a string, and using FromJson(x) to convert to structured data at query time is the best available workaround.

Sorry about the workflow disruption. If you can spot any other ways we could potentially support your use case please let me know.

nblumhardt avatar Mar 21 '24 02:03 nblumhardt

We appreciate the alphabetical ordering of properties, since it makes them easier to find.

Sebbl22 avatar Mar 22 '24 07:03 Sebbl22

Hi everyone; unfortunately, although we recognize that there's a valid request here, there are enough benefits both for the implementation and usage in the current alphabetical ordering scheme that we've decided to leave this as-is.

To guarantee a particular representation in Seq, raw string data is the recommended format - e.g. storing the original JSON in its own property at the source will provide the needed info here.

Thanks again, Nick

nblumhardt avatar May 29 '24 04:05 nblumhardt