logs-js
logs-js copied to clipboard
Adding option "snapshot" to an event
Heya 👋,
Working with the JS client on both the server and client and loving it so far.
Would it be possible to add some sort of "snapshot" field to to the event type which isn't indexed/searchable?
Essentially it would be nice to catch a snapshot of an HTTP request when it fails, or the response from a USB device etc... currently I am adding this data to the fields key and it does work, however it really muddies the fields column on the right hand side.
Just saw your comment on #4, potentially I should re-create the project?
You should be ok! unless you're hitting that error maximum allowed length of 1024 bytes you shouldn't need to re-create the project. Currently everything is always searchable, but having something like context along with fields might be nice as you mention just to keep it out of the UI.
I think it could be solved in the UI as well, maybe a menu item for the fields where you can hide everything nested so it's not so noisy
Hey @tj yes have been seeing the maximum allowed length of 1024 bytes error 😅 I should have said that! So will do a re-create!
I really like the sound of something like context, my main reason for not wanting to stringify the relative JSON to be part of the message is that I really really like the JSON viewer in the UI, and I want to be able to take advantage of this (this is a smaller log that doesn't include the blob as that has sensitive info):

Otherwise I agree it could be handled at a UI level, would this be handled via "level of nesting" i.e don't show fields below 3 levels?
ahh true, it would have to hide it in multiple locations, not just the "Discovered fields" panel. Maybe context is the way to go, I'll have to think about that some more