When all loggers have been removed from the builder, starting the application will result in an error.
This is even true when you tell Steeltoe not to use the DynamicLogger:
builder.AddSteeltoe(
new HashSet<string>
{
SteeltoeAssemblyNames.LoggingDynamicConsole,
})
System.InvalidOperationException: Sequence contains no elements
at System.Linq.ThrowHelper.ThrowNoElementsException() in /_/src/runtime/src/libraries/System.Linq/src/System/Linq/ThrowHelper.cs:line 24
at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source) in /_/src/runtime/src/libraries/System.Linq/src/System/Linq/Single.cs:line 13
at Steeltoe.Logging.DynamicConsole.LoggingBuilderExtensions.<>c.<AddDynamicConsole>b__0_0(IServiceProvider provider) in /_/src/Logging/src/DynamicConsole/LoggingBuilderExtensions.cs:line 37
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) in /_/src/runtime/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentDictionary.cs:line 1201
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Steeltoe.Management.Endpoint.ActuatorRouteBuilderExtensions.MapActuators(IEndpointRouteBuilder builder) in /_/src/Management/src/Endpoint/ActuatorRouteBuilderExtensions.cs:line 29
at Steeltoe.Management.Endpoint.ApplicationBuilderExtensions.<>c__DisplayClass1_0.<UseActuatorEndpoints>b__0(IEndpointRouteBuilder endpoints) in /_/src/Management/src/Endpoint/ApplicationBuilderExtensions.cs:line 58
at Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions.UseEndpoints(IApplicationBuilder builder, Action`1 configure)
at Steeltoe.Management.Endpoint.ApplicationBuilderExtensions.UseActuatorEndpoints(IApplicationBuilder builder, Action`1 configureEndpoints) in /_/src/Management/src/Endpoint/ApplicationBuilderExtensions.cs:line 56
at Steeltoe.Management.Endpoint.ApplicationBuilderExtensions.UseActuatorEndpoints(IApplicationBuilder builder) in /_/src/Management/src/Endpoint/ApplicationBuilderExtensions.cs:line 27
at Steeltoe.Management.Endpoint.ConfigureActuatorsMiddlewareStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app) in /_/src/Management/src/Endpoint/ConfigureActuatorsMiddlewareStartupFilter.cs:line 38
at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__14_1(IHostedService service, CancellationToken token)
at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
2
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at Root.Program.Main(String[] args) in /home/reinier/LocalProjects/gologic/DotNet/GridboxServer/src/Program.cs:line 64
Describe the bug
When all loggers have been removed from the builder, starting the application will result in an error.
This is even true when you tell Steeltoe not to use the DynamicLogger:
Steps to reproduce
Steps to reproduce the behavior:
result:
Expected behavior
No error
Environment (please complete the following information):