Show / Hide Table of Contents

Class LoggingExtensions

Extension utilities for logging

Inheritance
object
LoggingExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Cognite.Extractor.Logging
Assembly: Cognite.Logging.dll
Syntax
public static class LoggingExtensions

Methods

| Edit this page View Source

AddLogger(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
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX