sbom-tool icon indicating copy to clipboard operation
sbom-tool copied to clipboard

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

Open JamieMagee opened this issue 2 years ago • 3 comments

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.

JamieMagee avatar Jun 28 '23 18:06 JamieMagee

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

ryanbrandenburg avatar Jul 31 '23 18:07 ryanbrandenburg

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.

JamieMagee avatar Jul 31 '23 20:07 JamieMagee

Closed #467 and #352, which were drafts to address this. Looking at the component-detection code base, they're still using a mixture of loggers.

DaveTryon avatar Feb 21 '25 23:02 DaveTryon