Note: This API is now obsolete.
Allows components that are built by Simple Injector to depend on the (non-generic)
Microsoft.Extensions.Logging.ILogger abstraction. Components are
injected with an contextual implementation. Using this method, application components can simply
depend on ILogger instead of its generic counter part, ILogger<T>, which
simplifies development.
Namespace: SimpleInjector
Assembly: SimpleInjector.Integration.ServiceCollection (in SimpleInjector.Integration.ServiceCollection.dll) Version: 4.10.3
Syntax
[ObsoleteAttribute("Please call services.AddSimpleInjector(options => { options.AddLogging(); } instead on the IServiceCollection instance. For more information, see: https://simpleinjector.org/servicecollection. Will be removed in version 5.0.", true)] [EditorBrowsableAttribute(EditorBrowsableState.Never)] public static SimpleInjectorUseOptions UseLogging( this SimpleInjectorUseOptions options )
Parameters
- options
- Type: SimpleInjectorSimpleInjectorUseOptions
The options.
Return Value
Type: SimpleInjectorUseOptionsThe supplied options.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type SimpleInjectorUseOptions. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when options is a null reference. |
InvalidOperationException | Thrown when no ILoggerFactory entry can be found in the framework's list of services defined by IServiceCollection. |
See Also