Class LoggingExtensions
Extension utilities for logging
Inherited Members
Namespace: Cognite.Extractor.Logging
Assembly: Cognite.Logging.dll
Syntax
public static class LoggingExtensions
Methods
| Edit this page View SourceAddLogger(IServiceCollection, Func<LoggerConfig, ILogger>?, bool)
Adds a configured Serilog logger as singletons of the ILogger and
Serilog.ILogger types to the services
collection.
A configuration object of type LoggerConfig is required, and should have been added to the
collection as well.
Declaration
public static void AddLogger(this IServiceCollection services, Func<LoggerConfig, ILogger>? buildLogger = null, bool alternativeLogger = false)
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The service collection |
Func<LoggerConfig, ILogger> | buildLogger | Method to build the logger. True to allow alternative loggers, i.e. allow config.Console and config.File to be null This defaults to GetConfiguredLogger(LoggerConfig), which creates logging configuration for file and console using GetConfiguration(LoggerConfig) |
bool | alternativeLogger |