Streaming events: can't deserialize `Trace` level (writing events with MS.Ext.Logging)
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 86
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
tl;dr:
When writing logs with MS Ext Logging and streaming them back to application as demonstrated in this library documentation, deserializing LogEvent using LogEventReader.ReadFromJObject fails with exception "Requested value 'Trace' was not found".
long verson:
I'm using Seq as a logging storage for Microsoft.Extensions.Logging based app (using Seq.Extensions.Logging)
Therefore the message levels stored in Seq are levels defined by MS Ext Logging.
When streaming events back to the application, the documentation states the events should be deserialized into Serilog's LogEvent instances (using LogEventReader.ReadFromJObject) - unfortunately, the level is Serilog's LogEventLevel which is not compatible with MS Ext Logging levels (Trace vs Verbose and Critical vs Fatal)
Technical aspects of the issue aside, I find it a little inconsistent:
- using
SeqConnection.Events.Find / Listmethods, we deal with Seq'sEventEntity(which definesLevelasstringso we're fine here) - using
SeqConnection.Events.Streammethod we deal with the Serilog'sLogEventjson representation for some reason
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the documented streaming example and inspect SeqConnection.Events.Stream together with LogEventReader.ReadFromJObject. Compare the streamed level values with Serilog's LogEvent representation and the EventEntity level handling in Events.Find/List. Done means streamed events can be deserialized without the reported Trace-level failure and the level behavior is consistent with the chosen representation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100