Yes, I only have one logger instance created within my hosted service, but there are also other loggers instantiated namely the standard loggers of the MS-hosted server.
I may also have multiple logger providers in my project in the future, but I only have to acces the one with the memory.
However, I checked, what's in the logger instance. There are 3 Logger arrays:
- Loggers (of type LoggerInformation)
- MessageLoggers (of type MessageLogger)
- ScopeLoggers (of type ScopeLogger)
Within the Loggers I have 6 items, which I think, are the loggers of the project, also built ins like console logger, debug logger, etc.
Within the MessageLoggers, I also have 6 loggers, however, I could find myLoggerProvider in this list.
ScopeLoggers are for Scope, however, I also find my provider in that list, as I use scope.
But as these properties are not accessable by standard, I should use reflection to access it as well as I have to loop through all items to find MyLoggerProvider.
Do you have an idea if there is another, simpler way to access MyLogerProvider?
Eg. I have to use the right type of _logger to make these properties accessible.