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

Switch to Microsoft.Extensions.Logging #1110

Closed
bgrainger opened this issue Jan 2, 2022 · 1 comment · Fixed by #1268
Closed

Switch to Microsoft.Extensions.Logging #1110

bgrainger opened this issue Jan 2, 2022 · 1 comment · Fixed by #1268
Assignees
Milestone

Comments

@bgrainger
Copy link
Member

MySqlConnector currently implements logging via a custom interface: #390

Npgsql is planning to replace their custom logging interface with Microsoft.Extensions.Logging (npgsql/npgsql#2103 (comment)):

Looking at this again, we should really consider switching to Microsoft.Extensions.Logging - there isn't any reason not to do that any more:

  • It's the de-facto standard library in the .NET ecosystem
  • It's definitely high-perf (used in ASP.NET itself), there's even new source generation support in .NET 6.0.
  • It allows effortless logging to a wide variety of destinations; with Npgsql's custom logging, adapters need to be coded up manually every time.
  • The only drawback I can think of is having to reference Microsoft.Extensions.Logging.Abstractions, which I don't love, but I think it makes sense at this point.

All those advantages (and the drawback) are the same for MySqlConnector, and I reach the same conclusion: it's time to switch.

I assume this would be a source+binary breaking change, so it would go in the next major version.

@bgrainger
Copy link
Member Author

DbDataSource (dotnet/runtime#64812) could allow the ILoggerFactory to be specified.

bgrainger added a commit that referenced this issue Dec 28, 2022
Switch to Microsoft.Extensions.Logging.
@bgrainger bgrainger added this to the 2.3 milestone Dec 28, 2022
@bgrainger bgrainger self-assigned this Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant