FlowFuse / flowfuse

Build bespoke, flexible, and resilient manufacturing low-code applications with FlowFuse and Node-RED
https://flowfuse.com
Other
269 stars 63 forks source link

Large entries in audit log #4071

Closed Steve-Mcl closed 1 month ago

Steve-Mcl commented 3 months ago

Current Behavior

Following addition of support for multiline env vars #4069 it was noted that imports of large fields cause rather large audit log entries.

Example (zoomed out on a 4k monitor): image

Expected Behavior

We should either drop logging of before and after values, log keys changed only or log a summary of changes

Steps To Reproduce

import large env file or add several large env vars to an instance/device

Environment

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

Steve-Mcl commented 1 month ago

Design

I propose we approach this from the view of Env Vars (where the issue was raised) rather than a general/overall logging update since I believe there are unique properties e.g.

Example Before:

Image

Proposal 1 mock up:

Image

Proposal 2 mock up: Image

knolleary commented 1 month ago

There are certainly other places where the way the audit log captures all before/after state and reports it simply doesn't scale. The new edit snapshot log entries is another case - where we log the full before/after description - which could be multiple paragraphs of text.

We don't want to have to fix each case individually; the default formatter for changes should just do a better job of it. I think hiding the specific changes by default is a good step. Then showing changes in a more structured way - rather than fully inline.