Show / Hide Table of Contents

Class LoggingUtils

Utility class for configuring extractor loggers. The logging framework used is Serilog. Loggers are created according to a LoggerConfig configuration object. Log messages contain UTC timestamps.

Inheritance
object
LoggingUtils
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 LoggingUtils

Fields

| Edit this page View Source

LogTemplate

Default logging template without context.

Declaration
public const string LogTemplate = "[{UtcTimestamp:yyyy-MM-dd HH:mm:ss.fff} {Level:u3}] {Message:lj}{NewLine}{Exception}"
Field Value
Type Description
string
| Edit this page View Source

LogTemplateWithContext

Default logging template with context.

Declaration
public const string LogTemplateWithContext = "[{UtcTimestamp:yyyy-MM-dd HH:mm:ss.fff} {Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}"
Field Value
Type Description
string

Methods

| Edit this page View Source

Configure(LoggerConfig)

Configure Serilog's shared logger according to the configuration in config. Use this method only when the static Serilog.Log is used by the application for logging

Declaration
public static void Configure(LoggerConfig config)
Parameters
Type Name Description
LoggerConfig config

Configuration object

| Edit this page View Source

GetConfiguration(LoggerConfig)

Creates Serilog.LoggerConfiguration according to the configuration in config

Declaration
public static LoggerConfiguration GetConfiguration(LoggerConfig config)
Parameters
Type Name Description
LoggerConfig config

Configuration object of LoggerConfig type

Returns
Type Description
LoggerConfiguration

A configured logger

| Edit this page View Source

GetConfiguredLogger(LoggerConfig)

Creates a Serilog.ILogger logger according to the configuration in config

Declaration
public static ILogger GetConfiguredLogger(LoggerConfig config)
Parameters
Type Name Description
LoggerConfig config

Configuration object of LoggerConfig type

Returns
Type Description
ILogger

A configured logger

| Edit this page View Source

GetDefault()

Create a default console logger and returns it.

Declaration
public static ILogger GetDefault()
Returns
Type Description
ILogger

A ILogger logger with default properties

| Edit this page View Source

GetSerilogDefault()

Create a default Serilog console logger and returns it.

Declaration
public static ILogger GetSerilogDefault()
Returns
Type Description
ILogger

A Serilog.ILogger logger with default properties

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX