microsoft / sbom-tool

The SBOM tool is a highly scalable and enterprise ready tool to create SPDX 2.2 compatible SBOMs for any variety of artifacts.
MIT License
1.61k stars 128 forks source link

Use `ILogger<T>` from `Microsoft.Extensions.Logging` instead of `ILogger` from Serilog #284

Open JamieMagee opened 1 year ago

JamieMagee commented 1 year ago

The SBOM tool uses Serilog's ILogger interface directly. Unfortunately, Component Detection expects the ILogger<T> interface from Microsoft.Extensions.Logging and uses the Serilog.Extensions.Logging package to provide an implementation.

In our research, using the Microsoft.Extensions.Logging logging API, and plugging in different logging frameworks (like Serilog) was the recommended approach.

ryanbrandenburg commented 1 year ago

We think this is already fixed, @sebasgomez238 the work item is to double-check that assumption.

JamieMagee commented 1 year ago

I think that some of this work was completed in #292. However, there are still a lot of use cases of ILogger directly from Serilog, instead of ILogger<T> from Microsoft.Extensions.Logging.

EDIT: Actually, it depends. The work was completed to upgrade Component Detection and all the logger references there. Actually working on the rest of the code base isn't required, but using two different logger interfaces is slightly confusing.