79417994

Date: 2025-02-06 13:07:14
Score: 1
Natty:
Report link

I found out how to do this, it turns out its pretty simple I just didn't think to look outside the ILogger code.

In your ILoggerProvider the ILogger CreateLogger(string categoryName) has the category name from ILogger<TCategoryName>. Just need to pass that to the constructor of your ILogger.

e.g. public ILogger CreateLogger(string categoryName) => new DbLogger(this, categoryName, TimeProvider.System);

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: ksja