Skip to content

Fast.Logging public API ​

Targets: net8.0;net9.0;net10.0. Select a type in the page outline to find its declaration and members. See the module guide for configuration, examples, and constraints.

Reference version 3.5.39. Source commit a8bd407bf5f6b811da7fb7bd1db827f4da119a94.

Fast.Logging.LogContext ​

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public sealed class LogContext

Logging context

Fast.Logging.LogContext.LogContext ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public LogContext()

Initializes a new instance of the class

Fast.Logging.LogContext.Properties ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public IDictionary<object, object> Properties { get; set; }

Logging context data

Fast.Logging.LogMessage ​

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public struct LogMessage

Structured log message

Fast.Logging.LogMessage.LogMessage ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public LogMessage(string logName, LogLevel logLevel, EventId? eventId, string message, Exception exception,
        LogContext context, object state, DateTime logDateTime, int threadId, bool useUtcTimestamp, string traceId)

Initializes a new instance of the class

  • Parameter logName: Log category name
  • Parameter logLevel: Log level
  • Parameter eventId: Logging event identifier
  • Parameter message: Message to record or return
  • Parameter exception: Exception to handle
  • Parameter context: Current logging context
  • Parameter state: Current state value
  • Parameter logDateTime: Log timestamp
  • Parameter threadId: Unique thread identifier
  • Parameter useUtcTimestamp: Whether to use UTC for log timestamps
  • Parameter traceId: Unique trace identifier

Fast.Logging.LogMessage.LogName ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public string LogName { get; }

Logger category name

Fast.Logging.LogMessage.LogLevel ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public LogLevel LogLevel { get; }

Log level

Fast.Logging.LogMessage.EventId ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public EventId? EventId { get; }

Event ID

Fast.Logging.LogMessage.Message ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public string Message { get; internal set; }

Log message

Fast.Logging.LogMessage.Exception ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public Exception Exception { get; }

Exception object

Fast.Logging.LogMessage.State ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public object State { get; }

Current state value

Remarks: May be of any type

Fast.Logging.LogMessage.LogDateTime ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public DateTime LogDateTime { get; }

Log timestamp

Fast.Logging.LogMessage.ThreadId ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public int ThreadId { get; }

Thread ID

Fast.Logging.LogMessage.UseUtcTimestamp ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public bool UseUtcTimestamp { get; }

Whether to use UTC timestamps

Fast.Logging.LogMessage.TraceId ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public string TraceId { get; }

Request/trace ID

Fast.Logging.LogMessage.Context ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public LogContext Context { get; set; }

Logging context

Fast.Logging.LogMessage.ToString ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public override readonly string ToString()

Documentation is inherited from an interface or base class; consult that declaration.

Fast.Logging.LoggingContext ​

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public static class LoggingContext

Logging context

Fast.Logging.LoggingContext.OutputStandardMessage ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static string OutputStandardMessage(LogMessage logMsg, string dateFormat = "yyyy-MM-dd HH:mm:ss.fffffff zzz dddd",
        bool isConsole = false, bool disableColors = true, bool withTraceId = false, bool withStackFrame = false)

Writes a standard log message

  • Parameter logMsg: Log message to format or write
  • Parameter dateFormat: Date/time format string
  • Parameter isConsole: Whether to write logs to the console
  • Parameter disableColors: Whether to disable console log colors
  • Parameter withTraceId: Trace identifier to include
  • Parameter withStackFrame: Whether to include the call-stack location in logs
  • Returns: Writes a standard log message

Fast.Logging.LoggingContext.GetLogLevelString ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static string GetLogLevelString(LogLevel logLevel)

Gets the short name of a log level

  • Parameter logLevel: Log level
  • Returns: Short log-level name

Fast.Logging.IServiceCollectionExtension ​

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public static class IServiceCollectionExtension

Dynamic API extensions for IServiceCollection

Fast.Logging.IServiceCollectionExtension.AddLoggingService ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static IServiceCollection AddLoggingService(this IServiceCollection services, IConfiguration configuration,
        string section = "Logging:Fast")

Registers logging services

  • Parameter services: The service collection to add services to
  • Parameter configuration: Configuration used to read module settings
  • Parameter section: JSON configuration section key; defaults to Logging:Fast
  • Returns: Returns services for chaining

Fast.Logging.LogContextExtension ​

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public static class LogContextExtension

LogContext extensions

Fast.Logging.LogContextExtension.Set ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static LogContext Set(this LogContext logContext, object key, object value)

Sets context data

  • Parameter logContext: Current logging context
  • Parameter key: Logging context property key
  • Parameter value: Property value to write to the logging context
  • Returns: Sets context data

Fast.Logging.LogContextExtension.SetRange ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static LogContext SetRange(this LogContext logContext, IDictionary<object, object> properties)

Sets multiple context properties

  • Parameter logContext: Current logging context
  • Parameter properties: Properties to write to the context
  • Returns: Sets multiple context properties

Fast.Logging.LogContextExtension.Get ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static object Get(this LogContext logContext, object key)

Gets context data

  • Parameter logContext: Current logging context
  • Parameter key: Logging context property key
  • Returns: Retrieved context data

Fast.Logging.LogContextExtension.Get ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static object Get<T>(this LogContext logContext, object key)

Gets context data

  • Parameter logContext: Current logging context
  • Parameter key: Logging context property key
  • Type parameter T: Target type of the context property value
  • Returns: Retrieved context data

Fast.Logging.LogMessageExtension ​

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public static class LogMessageExtension

LogMessage extensions

Fast.Logging.LogMessageExtension.Write ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static string Write(this LogMessage _, Action<Utf8JsonWriter> writeAction, bool writeIndented = false)

Efficiently creates a JSON object string

  • Parameter _: Extension-method receiver; its value is not included in the output
  • Parameter writeAction: Delegate that writes properties to the JSON writer
  • Parameter writeIndented: Whether to indent the JSON output
  • Returns: Efficiently creates a JSON object string

Fast.Logging.LogMessageExtension.WriteArray ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static string WriteArray(this LogMessage logMsg, Action<Utf8JsonWriter> writeAction, bool writeIndented = false)

Efficiently creates a JSON array string

  • Parameter logMsg: Log message to format or write
  • Parameter writeAction: Delegate that writes properties to the JSON writer
  • Parameter writeIndented: Whether to indent the JSON output
  • Returns: Efficiently creates a JSON array string

Fast.Logging.Log ​

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public static class Log

Global static logging class

Fast.Logging.Log.Default ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static StringLoggingPart Default()

Manual construction

  • Returns: Manual construction

Fast.Logging.Log.CreateLogger ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static ILogger CreateLogger<T>()

Creates a logger

  • Type parameter T: Type used as the logger category
  • Returns: Created logger

Fast.Logging.Log.CreateLoggerFactory ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static ILoggerFactory CreateLoggerFactory(Action<ILoggingBuilder> configure = null)

Creates a logger factory

Remarks: ILoggerFactory implements IDisposable; use using to manage its lifetime

  • Parameter configure: Logging configuration callback
  • Returns: Created logger factory

Fast.Logging.Log.ScopeContext ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static (ILogger logger, IDisposable scope) ScopeContext(IDictionary<object, object> properties)

Creates a logging scope containing the specified properties

  • Parameter properties: Properties to include in the logging scope; use System.Collections.Concurrent.ConcurrentDictionary{TKey,TValue} for concurrent mutation
  • Returns: Logger and disposable handle used to end the scope

Fast.Logging.Log.ScopeContext ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static (ILogger logger, IDisposable scope) ScopeContext(Action<LogContext> configure)

Creates a logging scope containing the specified properties

  • Parameter configure: Logging context configuration callback
  • Returns: Logger and disposable handle used to end the scope

Fast.Logging.Log.ScopeContext ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static (ILogger logger, IDisposable scope) ScopeContext(LogContext context)

Creates a logging scope containing the specified properties

  • Parameter context: Current logging context
  • Returns: Logger and disposable handle used to end the scope

Fast.Logging.Log.Information ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Information(string message, params object[] args)

Writes a LogLevel.Information log

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Information ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Information(string message, EventId eventId, params object[] args)

Writes a LogLevel.Information log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Information ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Information(string message, Exception exception, params object[] args)

Writes a LogLevel.Information log

  • Parameter message: Message to record or return
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Information ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Information(string message, EventId eventId, Exception exception, params object[] args)

Writes a LogLevel.Information log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Information ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Information<TClass>(string message, params object[] args)

Writes a LogLevel.Information log

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Information ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Information<TClass>(string message, EventId eventId, params object[] args)

Writes a LogLevel.Information log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Information ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Information<TClass>(string message, Exception exception, params object[] args)

Writes a LogLevel.Information log

  • Parameter message: Message to record or return
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Information ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Information<TClass>(string message, EventId eventId, Exception exception, params object[] args)

Writes a LogLevel.Information log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Warning ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Warning(string message, params object[] args)

Writes a LogLevel.Warning log

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Warning ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Warning(string message, EventId eventId, params object[] args)

Writes a LogLevel.Warning log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Warning ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Warning(string message, Exception exception, params object[] args)

Writes a LogLevel.Warning log

  • Parameter message: Message to record or return
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Warning ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Warning(string message, EventId eventId, Exception exception, params object[] args)

Writes a LogLevel.Warning log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Warning ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Warning<TClass>(string message, params object[] args)

Writes a LogLevel.Warning log

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Warning ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Warning<TClass>(string message, EventId eventId, params object[] args)

Writes a LogLevel.Warning log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Warning ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Warning<TClass>(string message, Exception exception, params object[] args)

Writes a LogLevel.Warning log

  • Parameter message: Message to record or return
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Warning ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Warning<TClass>(string message, EventId eventId, Exception exception, params object[] args)

Writes a LogLevel.Warning log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Error ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Error(string message, params object[] args)

Writes a LogLevel.Error log

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Error ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Error(string message, EventId eventId, params object[] args)

Writes a LogLevel.Error log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Error ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Error(string message, Exception exception, params object[] args)

Writes a LogLevel.Error log

  • Parameter message: Message to record or return
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Error ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Error(string message, EventId eventId, Exception exception, params object[] args)

Writes a LogLevel.Error log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Error ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Error<TClass>(string message, params object[] args)

Writes a LogLevel.Error log

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Error ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Error<TClass>(string message, EventId eventId, params object[] args)

Writes a LogLevel.Error log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Error ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Error<TClass>(string message, Exception exception, params object[] args)

Writes a LogLevel.Error log

  • Parameter message: Message to record or return
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Error ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Error<TClass>(string message, EventId eventId, Exception exception, params object[] args)

Writes a LogLevel.Error log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Debug ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Debug(string message, params object[] args)

Writes a LogLevel.Debug log

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Debug ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Debug(string message, EventId eventId, params object[] args)

Writes a LogLevel.Debug log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Debug ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Debug(string message, Exception exception, params object[] args)

Writes a LogLevel.Debug log

  • Parameter message: Message to record or return
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Debug ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Debug(string message, EventId eventId, Exception exception, params object[] args)

Writes a LogLevel.Debug log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Debug ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Debug<TClass>(string message, params object[] args)

Writes a LogLevel.Debug log

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Debug ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Debug<TClass>(string message, EventId eventId, params object[] args)

Writes a LogLevel.Debug log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Debug ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Debug<TClass>(string message, Exception exception, params object[] args)

Writes a LogLevel.Debug log

  • Parameter message: Message to record or return
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Debug ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Debug<TClass>(string message, EventId eventId, Exception exception, params object[] args)

Writes a LogLevel.Debug log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Trace ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Trace(string message, params object[] args)

Writes a LogLevel.Trace log

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Trace ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Trace(string message, EventId eventId, params object[] args)

Writes a LogLevel.Trace log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Trace ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Trace(string message, Exception exception, params object[] args)

Writes a LogLevel.Trace log

  • Parameter message: Message to record or return
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Trace ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Trace(string message, EventId eventId, Exception exception, params object[] args)

Writes a LogLevel.Trace log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Trace ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Trace<TClass>(string message, params object[] args)

Writes a LogLevel.Trace log

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Trace ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Trace<TClass>(string message, EventId eventId, params object[] args)

Writes a LogLevel.Trace log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Trace ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Trace<TClass>(string message, Exception exception, params object[] args)

Writes a LogLevel.Trace log

  • Parameter message: Message to record or return
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Trace ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Trace<TClass>(string message, EventId eventId, Exception exception, params object[] args)

Writes a LogLevel.Trace log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Critical ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Critical(string message, params object[] args)

Writes a LogLevel.Critical log

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Critical ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Critical(string message, EventId eventId, params object[] args)

Writes a LogLevel.Critical log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Critical ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Critical(string message, Exception exception, params object[] args)

Writes a LogLevel.Critical log

  • Parameter message: Message to record or return
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Critical ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Critical(string message, EventId eventId, Exception exception, params object[] args)

Writes a LogLevel.Critical log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message

Fast.Logging.Log.Critical ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Critical<TClass>(string message, params object[] args)

Writes a LogLevel.Critical log

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Critical ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Critical<TClass>(string message, EventId eventId, params object[] args)

Writes a LogLevel.Critical log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Critical ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Critical<TClass>(string message, Exception exception, params object[] args)

Writes a LogLevel.Critical log

  • Parameter message: Message to record or return
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.Log.Critical ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Critical<TClass>(string message, EventId eventId, Exception exception, params object[] args)

Writes a LogLevel.Critical log

  • Parameter message: Message to record or return
  • Parameter eventId: Logging event identifier
  • Parameter exception: Exception to handle
  • Parameter args: Arguments used to format the message
  • Type parameter TClass: Type of the object to process

Fast.Logging.LoggerFormatter ​

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public static class LoggerFormatter

Static log formatting class

`Fast.Logging.LoggerFormatter.Json = logMsg => ​

{
    return logMsg.Write(writer => WriteJson(logMsg, writer));
}`

Source · Targets: net8.0, net9.0, net10.0

csharp
public static readonly Func<LogMessage, string> Json = logMsg =>
    {
        return logMsg.Write(writer => WriteJson(logMsg, writer));
    };

JSON output formatting

`Fast.Logging.LoggerFormatter.JsonIndented = logMsg => ​

{
    return logMsg.Write(writer => WriteJson(logMsg, writer), true);
}`

Source · Targets: net8.0, net9.0, net10.0

csharp
public static readonly Func<LogMessage, string> JsonIndented = logMsg =>
    {
        return logMsg.Write(writer => WriteJson(logMsg, writer), true);
    };

JSON output formatting

Fast.Logging.StringLoggingPart ​

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public sealed partial class StringLoggingPart

Partial class for building string logs

Fast.Logging.StringLoggingPart.Default ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public static StringLoggingPart Default()

Default static logging component

  • Returns: Default static logging component

Fast.Logging.StringLoggingPart.Message ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public string Message { get; private set; }

Log content

Fast.Logging.StringLoggingPart.Level ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public LogLevel Level { get; private set; } = LogLevel.Information;

Log level

Fast.Logging.StringLoggingPart.Args ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public object[] Args { get; private set; }

Message formatting arguments

Fast.Logging.StringLoggingPart.EventId ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public EventId? EventId { get; private set; }

Event ID

Fast.Logging.StringLoggingPart.CategoryType ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public Type CategoryType { get; private set; } = typeof(StringLogging);

Log category type

Fast.Logging.StringLoggingPart.Exception ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public Exception Exception { get; private set; }

Exception object

Fast.Logging.StringLoggingPart.LoggerScoped ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public IServiceProvider LoggerScoped { get; private set; }

Scope containing the logging object

Fast.Logging.StringLoggingPart.LogContext ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public LogContext LogContext { get; private set; }

Logging context

Fast.Logging.StringLoggingPart ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public sealed partial class StringLoggingPart

Partial class for building string logs

Fast.Logging.StringLoggingPart.LogInformation ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public void LogInformation()

Information

Fast.Logging.StringLoggingPart.LogWarning ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public void LogWarning()

Warning

Fast.Logging.StringLoggingPart.LogError ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public void LogError()

Error

Fast.Logging.StringLoggingPart.LogDebug ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public void LogDebug()

Debug

Fast.Logging.StringLoggingPart.LogTrace ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public void LogTrace()

Trace

Fast.Logging.StringLoggingPart.LogCritical ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public void LogCritical()

Critical

Fast.Logging.StringLoggingPart.Log ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public void Log()

Writes a log using the current level, event, and exception settings

Fast.Logging.StringLoggingPart ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public sealed partial class StringLoggingPart

Partial class for building string logs

Fast.Logging.StringLoggingPart.SetMessage ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public StringLoggingPart SetMessage(string message)

Sets the message

  • Parameter message: Message to record or return
  • Returns: Sets the message

Fast.Logging.StringLoggingPart.SetLevel ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public StringLoggingPart SetLevel(LogLevel level)

Sets the log level

  • Parameter level: Log level
  • Returns: Sets the log level

Fast.Logging.StringLoggingPart.SetArgs ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public StringLoggingPart SetArgs(params object[] args)

Sets message formatting arguments

  • Parameter args: Arguments used to format the message
  • Returns: Sets message formatting arguments

Fast.Logging.StringLoggingPart.SetEventId ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public StringLoggingPart SetEventId(EventId eventId)

Sets the event ID

  • Parameter eventId: Logging event identifier
  • Returns: Sets the event ID

Fast.Logging.StringLoggingPart.SetCategory ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public StringLoggingPart SetCategory<TClass>()

Sets the log category

  • Type parameter TClass: Type of the object to process
  • Returns: Sets the log category

Fast.Logging.StringLoggingPart.SetException ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public StringLoggingPart SetException(Exception exception)

Sets the exception object

  • Parameter exception: Exception to handle
  • Returns: Sets the exception object

Fast.Logging.StringLoggingPart.SetLoggerScoped ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public StringLoggingPart SetLoggerScoped(IServiceProvider serviceProvider)

Sets the logging service scope

  • Parameter serviceProvider: Service provider used for resolution; null uses the current request or root provider
  • Returns: Sets the logging service scope

Fast.Logging.StringLoggingPart.ScopeContext ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public StringLoggingPart ScopeContext(IDictionary<object, object> properties)

Configures the logging context

  • Parameter properties: Properties to write to the context
  • Returns: Logger and disposable handle used to end the scope

Fast.Logging.StringLoggingPart.ScopeContext ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public StringLoggingPart ScopeContext(Action<LogContext> configure)

Configures the logging context

  • Parameter configure: Logging context configuration callback
  • Returns: Logger and disposable handle used to end the scope

Fast.Logging.StringLoggingPart.ScopeContext ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public StringLoggingPart ScopeContext(LogContext context)

Configures the logging context

  • Parameter context: Current logging context
  • Returns: Logger and disposable handle used to end the scope

Fast.Logging.LoggingSettingsOptions ​

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public class LoggingSettingsOptions : IPostConfigure

Logging options

Fast.Logging.LoggingSettingsOptions.FileFormat ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public string FileFormat { get; set; }

File format string

Fast.Logging.LoggingSettingsOptions.FileSizeLimit ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public int? FileSizeLimit { get; set; }

File size limit in bytes

Fast.Logging.LoggingSettingsOptions.MiniLogLevel ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public LogLevel? MiniLogLevel { get; set; }

Minimum log level

Fast.Logging.LoggingSettingsOptions.EnableCritical ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public bool? EnableCritical { get; set; }

Enables LogLevel.Critical logs

Fast.Logging.LoggingSettingsOptions.PostConfigure ​

Source · Targets: net8.0, net9.0, net10.0

csharp
public void PostConfigure()

Documentation is inherited from an interface or base class; consult that declaration.