LoggingServiceCollectionExtensions.AddLogging 方法

定義

多載

AddLogging(IServiceCollection)

將記錄服務新增至指定的 IServiceCollectionAdds logging services to the specified IServiceCollection.

AddLogging(IServiceCollection, Action<ILoggingBuilder>)

將記錄服務新增至指定的 IServiceCollectionAdds logging services to the specified IServiceCollection.

AddLogging(IServiceCollection)

將記錄服務新增至指定的 IServiceCollectionAdds 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

要新增服務的 IServiceCollectionThe IServiceCollection to add services to.

傳回

IServiceCollection,讓其他呼叫可以進行鏈結。The IServiceCollection so that additional calls can be chained.

AddLogging(IServiceCollection, Action<ILoggingBuilder>)

將記錄服務新增至指定的 IServiceCollectionAdds 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

要新增服務的 IServiceCollectionThe IServiceCollection to add services to.

configure
Action<ILoggingBuilder>

ILoggingBuilder 組態委派。The ILoggingBuilder configuration delegate.

傳回

IServiceCollection,讓其他呼叫可以進行鏈結。The IServiceCollection so that additional calls can be chained.

適用於