Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update RELEASE_NOTES.md for 1.5.22 release #461

Merged

Conversation

Arkatufus
Copy link
Contributor

[1.5.22] / 4 June 2024

Filtering Logs In Akka.NET

In Akka.NET 1.5.21, we introduced log filtering for log messages based on the LogSource or the content of a log message. Depending on your coding style, you can use this feature in Akka.Hosting in several ways.

  1. Using The LoggerConfigBuilder.WithLogFilter() method.

    The LoggerConfigBuilder.WithLogFilter() method lets you set up the LogFilterBuilder

    builder.Services.AddAkka("MyActorSystem", configurationBuilder =>
    {
        configurationBuilder
            .ConfigureLoggers(loggerConfigBuilder =>
            {
                loggerConfigBuilder.WithLogFilter(filterBuilder =>
                {
                    filterBuilder.ExcludeMessageContaining("Test");
                });
            });
    });
  2. Setting the loggerConfigBuilder.LogFilterBuilder property directly.

    builder.Services.AddAkka("MyActorSystem", configurationBuilder =>
    {
        configurationBuilder
            .ConfigureLoggers(loggerConfigBuilder =>
            {
                loggerConfigBuilder.LogFilterBuilder = new LogFilterBuilder();
                loggerConfigBuilder.LogFilterBuilder.ExcludeMessageContaining("Test");
            });
    });

@Aaronontheweb Aaronontheweb enabled auto-merge (squash) June 4, 2024 21:34
Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aaronontheweb Aaronontheweb merged commit 1528345 into akkadotnet:dev Jun 4, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants