Class LogMessage
Represents a log message which is composed of a format string and format args.
Inherited Members
Namespace: Akka.Event
Assembly: Akka.dll
Syntax
public abstract class LogMessage
Remarks
Call ToString to get the formatted output. Supports semantic logging by extracting property names from message templates.
Constructors
| Edit this page View SourceLogMessage(ILogMessageFormatter, string)
Initializes an instance of the LogMessage with the specified formatter, format and args.
Declaration
public LogMessage(ILogMessageFormatter formatter, string format)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogMessageFormatter | formatter | The formatter for the LogMessage. |
| string | format | The string format of the LogMessage. |
Fields
| Edit this page View SourceFormatter
Declaration
protected readonly ILogMessageFormatter Formatter
Field Value
| Type | Description |
|---|---|
| ILogMessageFormatter |
Properties
| Edit this page View SourceFormat
Gets the format string of this log message.
Declaration
public string Format { get; }
Property Value
| Type | Description |
|---|---|
| string |
PropertyNames
Gets the property names extracted from the message template. For positional templates like "{0} and {1}", returns ["0", "1"]. For named templates like "{UserId} logged in", returns ["UserId"]. This property uses lazy initialization and caching for performance.
Declaration
public IReadOnlyList<string> PropertyNames { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
Methods
| Edit this page View SourceGetProperties()
Gets a dictionary of property names to their values. Combines PropertyNames with Parameters() to create name-value pairs. This method uses lazy initialization and caching for performance.
Declaration
public IReadOnlyDictionary<string, object> GetProperties()
Returns
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, object> | A read-only dictionary of property names and values |
Edit this page