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

Akka.Streams: make it easier to pass in a friendly LogSource name #7126

Closed
Aaronontheweb opened this issue Mar 19, 2024 · 0 comments · Fixed by #7168
Closed

Akka.Streams: make it easier to pass in a friendly LogSource name #7126

Aaronontheweb opened this issue Mar 19, 2024 · 0 comments · Fixed by #7168

Comments

@Aaronontheweb
Copy link
Member

Is your feature request related to a problem? Please describe.

Right now the built in .Log method in Akka.Streams prints out a lot of junk under the LogSource of one of the built-in materialized actors. It should be easier to pass in a human-friendly log source name as an ActorAttribute when organizing the stream.

Describe the solution you'd like

var task = source.DivertTo(evenSink, i => i % 2 == 0)
.AddAttributes(ActorAttributes.CreateLogSource(...))
.DivertTo(threeSink, i => i % 3 == 0)
.DivertTo(fiveSink, i => i % 5 == 0)
.RunWith(Sink.ForEach<int>(i => Console.WriteLine($"{i} is unhandled")), actorSystem);

Describe alternatives you've considered

I'm going to make a separate issue about the .Log method itself in Akka.Streams - maybe we can make that method customizable instead.

Aaronontheweb added a commit to Aaronontheweb/akka.net that referenced this issue Apr 24, 2024
@Aaronontheweb Aaronontheweb added this to the 1.5.20 milestone Apr 24, 2024
Aaronontheweb added a commit that referenced this issue Apr 24, 2024
* allow `LogSource.Create` to return itself

If a `LogSource` is passed into `LogSource.Create`, just return that.

* close #7126 - added default usable `LogSource`s to all stream stages

* API approvals

* enrich all stream stages with actor path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant