Table of Contents

Class FlowLogger

Namespace
CMS.Plugin.FlowManagement.Abstractions.FlowBusiness
Assembly
CMS.Plugin.FlowManagement.Abstractions.dll
public class FlowLogger : IFlowLogger, ILogger
Inheritance
FlowLogger
Implements
Inherited Members

Constructors

FlowLogger(ILogger, string, BusinessProcessflow)

Initializes a new instance of the FlowLogger class.

public FlowLogger(ILogger logger, string categoryName, BusinessProcessflow flow = null)

Parameters

logger ILogger

The logger.

categoryName string

Name of the category.

flow BusinessProcessflow

The flow.

Fields

OnLogFlowMessage

Occurs when [on log flow message].

public static FlowLogger.LogFlowMessageAsync OnLogFlowMessage

Field Value

FlowLogger.LogFlowMessageAsync

OnLogTraceMessage

Occurs when [on log press message].

public static FlowLogger.LogTraceMessageAsync OnLogTraceMessage

Field Value

FlowLogger.LogTraceMessageAsync

Properties

CategoryName

Gets the name of the category.

public string CategoryName { get; }

Property Value

string

The name of the category.

DebugLogger

public static ConcurrentDictionary<string, bool> DebugLogger { get; }

Property Value

ConcurrentDictionary<string, bool>

The debug logger.

EnableDebugLog

Gets or sets a value indicating whether [enable debug log].

public bool EnableDebugLog { get; set; }

Property Value

bool

true if [enable debug log]; otherwise, false.

Methods

AddExceptionToDetails(Exception, StringBuilder, bool)

Adds the exception to details.

protected virtual void AddExceptionToDetails(Exception exception, StringBuilder detailBuilder, bool sendStackTraceToClients)

Parameters

exception Exception

The exception.

detailBuilder StringBuilder

The detail builder.

sendStackTraceToClients bool

if set to true [send stack trace to clients].

BeginScope<TState>(TState)

Begins a logical operation scope.

public IDisposable BeginScope<TState>(TState state) where TState : notnull

Parameters

state TState

The identifier for the scope.

Returns

IDisposable

An IDisposable that ends the logical operation scope on dispose.

Type Parameters

TState

The type of the state to begin scope for.

GetLogLevel(LogLevel)

Gets the log level.

public string GetLogLevel(LogLevel logLevel)

Parameters

logLevel LogLevel

Returns

string

IsEnabled(LogLevel)

Checks if the given logLevel is enabled.

public bool IsEnabled(LogLevel logLevel)

Parameters

logLevel LogLevel

Level to be checked.

Returns

bool

true if enabled.

LogExceptionMessage(Exception, string, LogLevel?)

Logs the exception message.

public void LogExceptionMessage(Exception ex, string currentActivity = null, LogLevel? logLevel = LogLevel.Critical)

Parameters

ex Exception

The ex.

currentActivity string

The current activity.

logLevel LogLevel?

The log level.

LogMessage(string, string, LogLevel)

Logs the message.

public void LogMessage(string message, string currentActivity = null, LogLevel logLevel = LogLevel.Information)

Parameters

message string

The message.

currentActivity string

The current activity.

logLevel LogLevel

The log level.

LogPressMessage(string, string, string, string, LogLevel)

Logs the press message.

public void LogPressMessage(string type, string variable, string quality, string traceId, LogLevel logLevel = LogLevel.Information)

Parameters

type string

The type.

variable string

The variable.

quality string

The quality.

traceId string

The trace identifier.

logLevel LogLevel

The log level.

Log<TState>(LogLevel, EventId, TState, Exception, Func<TState, Exception, string>)

Writes a log entry.

public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)

Parameters

logLevel LogLevel

Entry will be written on this level.

eventId EventId

Id of the event.

state TState

The entry to be written. Can be also an object.

exception Exception

The exception related to this entry.

formatter Func<TState, Exception, string>

Function to create a string message of the state and exception.

Type Parameters

TState

The type of the object to be written.