Steeltoe
Steeltoe copied to clipboard
Bootstrap logging for Config Server not working as expected
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
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.