Class SemanticLogMessageFormatter
Message formatter that supports semantic logging with both positional and named templates. Implements the Message Templates specification, which is the language-neutral standard used by Serilog, Microsoft.Extensions.Logging, NLog, and other structured logging frameworks.
Implements
Inherited Members
Namespace: Akka.Event
Assembly: Akka.dll
Syntax
public sealed class SemanticLogMessageFormatter : ILogMessageFormatter
Remarks
Supported syntax:
- Named properties:
{PropertyName} - Positional properties:
{0},{1} - Format specifiers:
{Value:N2},{Date:yyyy-MM-dd} - Alignment:
{Value,10},{Value,-10} - Escaped braces:
{{→{,}}→}
Not supported:
- Destructuring operators:
{@Object},{$Object}(Serilog-specific) - Empty property names:
{:N2}(invalid per spec)
Fields
| Edit this page View SourceInstance
Gets the singleton instance of the SemanticLogMessageFormatter.
Declaration
public static readonly SemanticLogMessageFormatter Instance
Field Value
| Type | Description |
|---|---|
| SemanticLogMessageFormatter |
Methods
| Edit this page View SourceFormat(string, IEnumerable<object>)
Formats a log message using the specified format string and arguments.
Declaration
public string Format(string format, IEnumerable<object> args)
Parameters
| Type | Name | Description |
|---|---|---|
| string | format | The format string (supports both {0} and {PropertyName} styles) |
| IEnumerable<object> | args | The arguments to format |
Returns
| Type | Description |
|---|---|
| string | The formatted message string |
Format(string, params object[])
Formats a log message using the specified format string and arguments.
Declaration
public string Format(string format, params object[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| string | format | The format string (supports both {0} and {PropertyName} styles) |
| object[] | args | The arguments to format |
Returns
| Type | Description |
|---|---|
| string | The formatted message string |
Edit this page