LoggingServiceCollectionExtensions.AddLogging 方法
定义
重载
| AddLogging(IServiceCollection) |
将日志记录服务添加到指定的 IServiceCollection。Adds logging services to the specified IServiceCollection. |
| AddLogging(IServiceCollection, Action<ILoggingBuilder>) |
将日志记录服务添加到指定的 IServiceCollection。Adds logging services to the specified IServiceCollection. |
AddLogging(IServiceCollection)
将日志记录服务添加到指定的 IServiceCollection。Adds logging services to the specified IServiceCollection.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddLogging(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddLogging (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddLogging : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddLogging (services As IServiceCollection) As IServiceCollection
参数
- services
- IServiceCollection
要向其中添加服务的 IServiceCollection。The IServiceCollection to add services to.
返回
IServiceCollection,以便可以链接其他调用。The IServiceCollection so that additional calls can be chained.
适用于
AddLogging(IServiceCollection, Action<ILoggingBuilder>)
将日志记录服务添加到指定的 IServiceCollection。Adds logging services to the specified IServiceCollection.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddLogging(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<Microsoft::Extensions::Logging::ILoggingBuilder ^> ^ configure);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddLogging (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Extensions.Logging.ILoggingBuilder> configure);
static member AddLogging : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.Extensions.Logging.ILoggingBuilder> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddLogging (services As IServiceCollection, configure As Action(Of ILoggingBuilder)) As IServiceCollection
参数
- services
- IServiceCollection
要向其中添加服务的 IServiceCollection。The IServiceCollection to add services to.
- configure
- Action<ILoggingBuilder>
ILoggingBuilder 配置委托。The ILoggingBuilder configuration delegate.
返回
IServiceCollection,以便可以链接其他调用。The IServiceCollection so that additional calls can be chained.