[CSHARP-3893] Integrate with .NET Logging API Created: 05/Oct/21  Updated: 28/Oct/23  Resolved: 18/Oct/22

Status: Closed
Project: C# Driver
Component/s: Internal
Affects Version/s: None
Fix Version/s: 2.18.0

Type: Epic Priority: Unknown
Reporter: James Kovacs Assignee: Boris Dogadov
Resolution: Fixed Votes: 1
Labels: logging, size-medium
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by CSHARP-2829 Add logging to the driver Closed
Quarter: FY23Q2
Start date:
End date:
Calendar Time: 15 weeks, 2 days
Scope Cost Estimate: 3
Cost to Date: 6
Final Cost Estimate: 7
Cost Threshold %: 100
Detailed Project Statuses:

Engineer: Boris

Summary: Introduce logging to .Net driver.

2022-09-20: Updated target end date to 2022-09-23
Status Update:

  • In final stages of review
  • Documentation improvements up next
  • Added more time to wrap up the review and to add documentation

Rationale for delays:

  • No delays

Risks:

  • No risks

2022-09-06: No change to target end date
Status Update:

  • Boris getting back to feedback on the last PR now that he is back from vacation

Rationale for delays:

  • No delays

Risks:

  • No risks

Status Update:

  • Adding smoke tests in second round of reviews and everything else is wrapped up

Rationale for delays:

  • Boris is OOO for 2 weeks returning on 9/5

Risks:

  • No risks

2022-08-09: Updated target end date to 2022-09-19

Status Update:

  • Code review for Integration with the .NET Logging library and introducing basic logging continues
  • Adding smoke tests in progress

Rationale for delays:

  • Code reviews taking longer than expected
  • Intern mentorship

Risks:

  • No risks

2022-07-26: No change to target end date

Status Update:

  • Integration with the .NET Logging library and introducing basic logging in the drivers being reviewed
  • Working on adding smoke tests

Rationale for delays:

  • No delays

Risks:

  • No risks

2022-07-12: Updating target end date to 2022-07-29

Status Update:

  • Integration with the .NET Logging library and introducing basic logging in the drivers is in review
  • Working on adding smoke tests

Rationale for delays:

  • Smoke testing and infrastructure setup taking longer than expected

Risks:

  • No risks

2022-06-28: Updating target end date to 2022-07-15
Status Update:

  • PR for integration with the .NET Logging library would be ready in the next few days
  • Added some additional time to the end date for smoke testing, test migration and reviews

Rationale for delays:

  • Spent 50% of the time in the past two weeks on reviewing FLE related PRs, first responder rotation and mentoring interns

Risks:

  • No risks

2022-06-14: Setting initial target end date to 2022-07-01

Status Update:

  • Investigating integration with the .NET Logging library

Rationale for delays:

  • No delays

Risks:

  • No risks


 Description   

Historically .NET has not included a standard logging API and there were many competing open source offerings and custom solutions. As a result, the .NET/C# driver has not generated log messages. It integrates with TraceProviders and raises custom events (e.g. SDAM events), but there is no mechanism for the driver to log errors and warnings in a standardized way.

In the intervening years, Microsoft introduced Microsoft.Extensions.Logging, which is a NuGet package to define a standardized logging API. This API works with both built-in and third-party log providers. It would provide the driver with a mechanism to log messages in a log provider independent way.

The minimum .NET versions required for Microsoft.Extensions.Logging are .NET Standard 2.0 and .NET Framework 4.6.1 - which we now meet since we retired support for .NET Standard 1.5 and increased our minimum .NET Framework version to 4.7.2.

See Logging in .NET for an overview of .NET's logging support.



 Comments   
Comment by PM Bot [ 02/Feb/22 ]

If you are not logged in, you can view the tickets in this epic by following this link.

Comment by Boris Dogadov [ 05/Oct/21 ]

As Microsoft.Extensions.Logging is indeed extensively used package, one the concerns would be versions conflict. User's version is almost guaranteed not to match Driver's version, which will generate warnings and might force user to match his Microsoft.Extensions.Logging version.

Generated at Wed Feb 07 21:46:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.