Skip to content

SerilogMessageFormatter CTOR is private, can't be instantiated as the default LogMessageFormatter #217

Closed
@Aaronontheweb

Description

@Aaronontheweb

The formatter will get cached and reused automatically, once per ActorSystem instance, so there's no need for these types of singleton patterns anymore:

public static readonly SerilogLogMessageFormatter Instance = new();
/// <summary>
/// Initializes a new instance of the <see cref="SerilogLogMessageFormatter"/> class.
/// </summary>
private SerilogLogMessageFormatter()
{
_templateCache = new MessageTemplateCache(new MessageTemplateParser());
}

We should delete that optimization and make the default constructor public

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions