Closed MrzJkl closed 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
@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"
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