Search Results for

    Show / Hide Table of Contents

    Class LogMessage

    Represents a log message which is composed of a format string and format args.

    Inheritance
    object
    LogMessage
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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 Source

    LogMessage(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 Source

    Formatter

    Declaration
    protected readonly ILogMessageFormatter Formatter
    Field Value
    Type Description
    ILogMessageFormatter

    Properties

    | Edit this page View Source

    Format

    Gets the format string of this log message.

    Declaration
    public string Format { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    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 Source

    GetProperties()

    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

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET