Steeltoe icon indicating copy to clipboard operation
Steeltoe copied to clipboard

[QUESTION] Using Microsoft.Extensions.Logging with Config Server

Open thompson-tomo opened this issue 1 year ago • 1 comments

Question

How can i pass my logger which is of Microsoft.Extensions.Logging into AddConfigServer so that the logs from the config server configuration provider is in a consistent manner with the rest of my logs.

Environment (please complete the following information):

  • .NET 8
  • Steeltoe Version 3.2.6

Additional context or links

Add any other context about the problem here.

thompson-tomo avatar Apr 27 '24 09:04 thompson-tomo

Due to the way Configuration providers integrate with the any of the hosts Microsoft offers, you have to build a separate ILoggerFactory for use before the shared one is available. There are a couple of ways to do this here:

TimHess avatar Apr 29 '24 14:04 TimHess

Thanks @TimHess that has been super helpful, i has missed the logger factory option.

thompson-tomo avatar May 04 '24 00:05 thompson-tomo