Comments (10)
I'm a bit undecided at the moment, to be honest. I'd like to avoid having any container abstraction or service locator within the library. One question is for which scenarios we need logging. E.g. for general purpose actor logging, it can be injected via the actor producer. To log e.g. all received messages, it can be added as a middleware. If we want to log mailbox events, that can be done with the mailbox statistics extension. If there are more use cases, perhaps we can provide similar extension points for those?
from protoactor-dotnet.
Seems to be the standard for typical logging scenarios - see comment in the aspnet/Logging repo here: aspnet/Logging#332 (comment)
Another option that could be interesting is EventSource/ETW logging. E.g. if we want to log diagnostics.
from protoactor-dotnet.
I'm interested in taking a stab at this. How should this be done?
For internal logging only?
Added to the context like Akka.net? (I guess this is correct?)
I'm used to dependency injection so if something needs logging it just asks for it.
from protoactor-dotnet.
Giving this a go and running into chicken-and-egg problems.
I can't just replace all usages of Console with logger because things like EventStream
are always static. There's a lot of this.
I want to solve this by changing Props
to really be IServiceProvider
and use IoC to create objects. I'm guessing this is probably an unwelcome change.
from protoactor-dotnet.
Any thoughts about using IoC to resolve/create the proto actor primatives to inject logging? I would use the interfaces and stuff from the Microsoft.Extensions like logging.
I can try my best with a static implementation if that's desired instead.
@rogerasling @cpx86
from protoactor-dotnet.
Actor logging can be done themselves via the producer. I was going to optionally allow usage from the context because I figured the library itself would use that.
However I don't know how a logger factory can be shared among the primatives. Maybe nothing is needed.
from protoactor-dotnet.
In Go, we have a special EventStream where we push a LogMessage onto.
That way, anyone can subscribe to that and apply whatever log we want.
I think that would be the cleanest here too.
e.g.
Proto.Log.Stream.Subscribe( e => { myLogger.Warn(..) })
from protoactor-dotnet.
Cool. I'll look at ripping that off.
from protoactor-dotnet.
I've refactored the eventstream a little bit so it is possible to create a generic instance of it.
e.g.:
var stream = new EventStream<LogMessage>();
from protoactor-dotnet.
Fixed by #81
from protoactor-dotnet.
Related Issues (20)
- Who to create Data Flow DIagram HOT 2
- Don't log GossipTimeout if target node left the cluster HOT 1
- Log member information for gossip timeout HOT 1
- Kubernetes provider throws nullref, but recovers
- Gossip + Memberlist sync HOT 1
- Proto.Remote can go out of sync with Proto.Cluster HOT 1
- Two node seednode cluster: "Consensus not reached, Initiating rebalance" HOT 2
- Don't list blocked nodes unknown to self HOT 1
- Large cluster stability notes: HOT 2
- Gossip actor jam HOT 1
- Introduce IsStopping flag
- What is the difference between EventStream and pub-sub? HOT 2
- Remote blocking and Cluster MemberList HOT 2
- At-most-once guarantee is broken HOT 2
- Debugging documentation HOT 3
- Mocking grain client and testability HOT 2
- Is it possible for PubSub to lose messages without subscriber knowing?
- Kubernetes Provider on pod hostNetwork enabled HOT 1
- Amazon ECS cluster provider fails with AWS error
- SeedNode provider conceptually broken HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protoactor-dotnet.