-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add log filtering integration #460
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question about the two different ways of doing this, but otherwise looks good
README.md
Outdated
|
||
In Akka.NET 1.5.21, we introduced [log filtering for log messages based on the LogSource or the content of a log message](https://getakka.net/articles/utilities/logging.html#filtering-log-messages). Depending on your coding style, you can use this feature in Akka.Hosting in several ways. | ||
|
||
1. Using the `WithLogFilter()` `AkkaConfigurationBuilder` extension method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
README.md
Outdated
}); | ||
``` | ||
|
||
2. Using The `LoggerConfigBuilder.WithLogFilter()` method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[Fact(DisplayName = "WithLogFilter should inject LogFilterSetup")] | ||
public void WithLogFilterSetupTest() | ||
{ | ||
var builder = new AkkaConfigurationBuilder(new ServiceCollection(), "fake") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -96,6 +98,13 @@ public LoggerConfigBuilder ClearLoggers() | |||
return this; | |||
} | |||
|
|||
public LoggerConfigBuilder WithLogFilter(Action<LogFilterBuilder> filterBuilder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I'm not so sure about - what happens if someone calls this and ConfigureLogging
(or whatever it's called?) - can't we end up with one config overriding the other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the two implementation inside ConfigureLoggers(builder)
and the extension method AkkaConfigurationBuilder.WithLogFilter()
is exclusive to each other. The first being added would win because of how we retrieve Setup
classes in ActorSystem.Settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - we decided to stick with just the LogConfigBuilder
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (once API approvals are in)
README.md
Outdated
builder.Services.AddAkka("MyActorSystem", configurationBuilder => | ||
{ | ||
configurationBuilder | ||
.WithLogFilter(filterBuilder => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - glad we consolidated this.
No description provided.