Skip to content

Switch to Microsoft.Extensions.Logging #1110

@bgrainger

Description

@bgrainger

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions