-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
Milestone
Description
I made the mistake of adding static to my LoggerMessage method (through copy-paste mistake) and I wanted to use my instance ILogger _logger field, so I didn't have an ILogger in the method parameters.
I got this error message:
Severity Code Description Project File Line Suppression State
Error SYSLIB1008 One of the arguments to a logging method must implement the Microsoft.Extensions.Logging.ILogger interface Microsoft.Extensions.Diagnostics.HealthChecks C:\git\aspnetcore\src\HealthChecks\HealthChecks\src\HealthCheckPublisherHostedService.cs 207
This message didn't help me right away because I didn't want to pass an ILogger in the arguments. So it took me a while to realize the method was static and that was the issue.
We should update this message to also include that the method is static.