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
loggerILoggerThe logger.
categoryNamestringName of the category.
flowBusinessProcessflowThe 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
trueif [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
exceptionExceptionThe exception.
detailBuilderStringBuilderThe detail builder.
sendStackTraceToClientsboolif 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
stateTStateThe identifier for the scope.
Returns
- IDisposable
An IDisposable that ends the logical operation scope on dispose.
Type Parameters
TStateThe type of the state to begin scope for.
GetLogLevel(LogLevel)
Gets the log level.
public string GetLogLevel(LogLevel logLevel)
Parameters
logLevelLogLevel
Returns
IsEnabled(LogLevel)
Checks if the given logLevel is enabled.
public bool IsEnabled(LogLevel logLevel)
Parameters
logLevelLogLevelLevel to be checked.
Returns
- bool
trueif 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
messagestringThe message.
currentActivitystringThe current activity.
logLevelLogLevelThe 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
typestringThe type.
variablestringThe variable.
qualitystringThe quality.
traceIdstringThe trace identifier.
logLevelLogLevelThe 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
logLevelLogLevelEntry will be written on this level.
eventIdEventIdId of the event.
stateTStateThe entry to be written. Can be also an object.
exceptionExceptionThe exception related to this entry.
formatterFunc<TState, Exception, string>Function to create a string message of the
stateandexception.
Type Parameters
TStateThe type of the object to be written.