shinyorg / shiny

.NET Framework for Backgrounding & Device Hardware Services (iOS, Android, & Catalyst)
https://shinylib.net
MIT License
1.43k stars 227 forks source link

[Feature Request]: Add Exception and Logger Property to LogStore SQLite #1495

Closed MrzJkl closed 2 months ago

MrzJkl commented 2 months ago

Summary

Currently, only the pure message from the ILogger-LogEvent is written to the database in SQLite logging. Important information, such as the exception details and the logger (i.e. the generic attribute of the ILogger), is lost. As a result, you do not know which error has occurred and which logger has logged it.

So what needs to be done is to extend the LogStore class, i.e. the data model of how a LogEvent is written in SQLite, to include the Exception (string?) and Logger (string?) properties.

Translated with DeepL.com (free version)

API Changes

LogStore Class add Exception string + Logger string

Intended Use Case

Just know what happened and where :)

Code of Conduct

aritchie commented 2 months ago

Microsoft.Extensions.Logging - ILogger is used everywhere including potential error points. I'm not even sure what you're asking for here

MrzJkl commented 2 months ago

@aritchie Thx for your quick reply. I added additional notes. Im talking about SQLite Logging.

At the moment its just var message = formatter(state, exception); this.conn.GetConnection().Insert(new LogStore { Message = message, EventId = eventId.Id, LogLevel = logLevel, TimestampUtc = DateTime.UtcNow });

What i want to have logged additionally is e.g. Bad argument: TestClass (type TestClass) Exception information: System.ArgumentException: Object must be of type String. at System.String.CompareTo(Object value) at Example.Main()

and Logger "Example.Main"