-
Notifications
You must be signed in to change notification settings - Fork 244
Conversation
|
Would it be possible to make the function that writes the dictionary out to the response replaceable in ElmOptions? Like that, I could add transform it into JSON and integrate it into some kind of management dashboard. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throwing an exception here will make MVC unusable as it relies on BeginScope for its route handler and the default action selector.
If you don't wanna implement it yet, I'd suggest returning either null or a dummy IDisposable (returning null shouldn't be an issue given that BeginScope is only used with using, but a custom IDisposable is probably better).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the catch!
|
@borgdylan I am working on abstracting the storage system of the logs |
|
@sonjakhan that would help a lot since I do all my UI in AngularJS+WInJS which means data is fetched as JSON. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can initialize the property inline. Something like this:
public static List<string> Log { get; set; } = new List<string>();There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the setter would be even better 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all being removed anyways 😸
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Baby steps 😋
|
This is pretty ugly right now and doesn't show all the data that's stored. Grouping by request, filtering by severity, sorting by time, etc are things I was thinking about implementing but I wanted to get some feedback before I went too far down a bad path. Linking to the full details of a request is also important - currently I store whatever is in LogContext, which is probably missing a couple of properties. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I imagine that you could also use an instance store and declare ElmStore as singleton instead of transient.
|
|
Working on fixes to scoping, and will reopen a pull request in the Diagnostics repo when finished. |





A basic implementation of ELM, a wannabe ELMAH. Currently the logs are written to a dictionary and are displayed in plain text