TylerBrock / saw

Fast, multi-purpose tool for AWS CloudWatch Logs
MIT License
1.41k stars 79 forks source link

Does not preserve json property order #32

Open joeflateau opened 5 years ago

joeflateau commented 5 years ago

Json objects in logs have their properties reordered alphabetically instead of as logged.

Log

{ "b":1, "c":1, "a":1 }

Will print

{ "a":1, "b":1, "c":1 }
unsign3d commented 5 years ago

I don't know if it's a bug or a feature to be honest.

The problem is in https://github.com/TylerBrock/colorjson, tl;dr it's an expected behaviour of that Marshaller to reorder the keys.

@TylerBrock it could be a nice feature for colorjson to have a flag for reorder or not (it could improve performance on big JSON) and you could put it also as a config flag here

unsign3d commented 5 years ago

@TylerBrock if it's considered a bug (or a nice enhancement) I would like to work on it on both projects