Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
MrzJkl opened this issue Jul 3, 2024 · 2 comments
Closed
1 task done
Labels
feature request New feature or request unverified This issue has not been verified by a maintainer

Comments

@MrzJkl
Copy link

MrzJkl commented Jul 3, 2024

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

  • I agree to follow this project's Code of Conduct
@MrzJkl MrzJkl added feature request New feature or request unverified This issue has not been verified by a maintainer labels Jul 3, 2024
@aritchie
Copy link
Member

aritchie commented Jul 3, 2024

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

@MrzJkl MrzJkl changed the title [Feature Request]: Add Exception and Logger Property to LogStore [Feature Request]: Add Exception and Logger Property to LogStore SQLite Jul 3, 2024
@MrzJkl
Copy link
Author

MrzJkl commented Jul 3, 2024

@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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request unverified This issue has not been verified by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants