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
ILoggerThe logger.
categoryName
stringName of the category.
flow
BusinessProcessflowThe flow.
Fields
OnLogFlowMessage
Occurs when [on log flow message].
public static FlowLogger.LogFlowMessageAsync OnLogFlowMessage
Field Value
OnLogTraceMessage
Occurs when [on log press message].
public static FlowLogger.LogTraceMessageAsync OnLogTraceMessage
Field Value
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
ExceptionThe exception.
detailBuilder
StringBuilderThe detail builder.
sendStackTraceToClients
boolif 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
TStateThe 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
IsEnabled(LogLevel)
Checks if the given logLevel
is enabled.
public bool IsEnabled(LogLevel logLevel)
Parameters
logLevel
LogLevelLevel 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
LogMessage(string, string, LogLevel)
Logs the message.
public void LogMessage(string message, string currentActivity = null, LogLevel logLevel = LogLevel.Information)
Parameters
message
stringThe message.
currentActivity
stringThe current activity.
logLevel
LogLevelThe 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
stringThe type.
variable
stringThe variable.
quality
stringThe quality.
traceId
stringThe trace identifier.
logLevel
LogLevelThe 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
LogLevelEntry will be written on this level.
eventId
EventIdId of the event.
state
TStateThe entry to be written. Can be also an object.
exception
ExceptionThe exception related to this entry.
formatter
Func<TState, Exception, string>Function to create a string message of the
state
andexception
.
Type Parameters
TState
The type of the object to be written.