Steeltoe icon indicating copy to clipboard operation
Steeltoe copied to clipboard

Bootstrap logging for Config Server not working as expected

Open TimHess opened this issue 3 weeks ago • 1 comments

Describe the bug

Either of these should produce logs for the config server

var loggerFactory = BootstrapLoggerFactory.CreateConsole();
// or
var loggerFactory = BootstrapLoggerFactory.CreateConsole(logging => logging.SetMinimumLevel(LogLevel.Trace));

builder.AddCloudFoundryConfiguration(loggerFactory);

But I'm not seeing anything relevant in the console

Steps to reproduce

See example

Expected behavior

We should see logs of config server related requests when this code is used:

Environment (please complete the following information):

  • Steeltoe 4.0
  • Platform: local, TP
  • .NET Version .NET 9.0 or 8.0

TimHess avatar Dec 04 '25 22:12 TimHess

Either of these should produce logs for the config server

That's not how it works. See test Can_override_minimum_level. The default minimum level in .NET is Information. This can be customized per category via configuration.

Calling BootstrapLoggerFactory.CreateConsole() logs at level Information and higher. If you need Debug/Trace logging, either configure it inline or load categories from appsettings.json, such as here.

bart-vmware avatar Dec 09 '25 09:12 bart-vmware