-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
Pick a logging abstraction #18
Comments
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. |
I'm interested in taking a stab at this. How should this be done? I'm used to dependency injection so if something needs logging it just asks for it. |
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 I want to solve this by changing |
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 |
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? |
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. |
In Go, we have a special EventStream where we push a LogMessage onto. e.g. |
Cool. I'll look at ripping that off. |
I've refactored the eventstream a little bit so it is possible to create a generic instance of it. var stream = new EventStream<LogMessage>(); |
Fixed by #81 |
My impression is that the https://www.nuget.org/packages/microsoft.extensions.logging.abstractions/ is what will become the de-facto standard for logging in .NET.
After all, this is what is baked into Asp.NET Core.
Thoughts, should we aim for this?
The text was updated successfully, but these errors were encountered: