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

Automatically convert ILoggingAdapter into SerilogLoggingAdapter when FromContext is called. #284

Closed
Aaronontheweb opened this issue May 28, 2024 · 3 comments · Fixed by #285

Comments

@Aaronontheweb
Copy link
Member

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

https://stackoverflow.com/questions/78400210/akka-net-1-5-serilog-logger-not-adding-extra-properties-when-using-forcontext/78410544?noredirect=1#comment138457383_78410544 - we promised to do this during our May 2024 Akka.NET Community Standup:

https://petabridge.notion.site/5-15-2024-Akka-NET-Community-Standup-0b6a6dd4ca2f4a0e974056afe744ebb5?pvs=4

https://www.youtube.com/watch?v=jOBFvXW1nUc

Describe the solution you'd like

Basically, this should just return a SerilogLoggingAdapter implicitly - even if the underlying ILoggingAdapter used one of the built-in Akka.NET default implementations of LoggingAdapterBase:

  // this way does NOT render the FromContext property in the output, contrary to documentation
 Context.GetLogger()
            .ForContext("FromContextProperty", "bbb")
            .Error("NEW WAY {FromMessageProperty}", txt);
@Aaronontheweb
Copy link
Member Author

First thing we're going to need to do to support this properly is to expose the EventStream on the BugLogging class in Akka.NET, so that's going to require another Akka.NET release to address this.

Aaronontheweb added a commit to Aaronontheweb/Akka.Logger.Serilog that referenced this issue May 29, 2024
Aaronontheweb added a commit that referenced this issue Jun 4, 2024
…n `ForContext` is called (#285)

* implicitly convert regular `BusLogger` to `SerilogLoggingAdapter` when `ForContext` is called

close #284

* updated README
@ilyatch
Copy link

ilyatch commented Jun 17, 2024

Can this release be published to Nuget now that it's all done?

@Aaronontheweb
Copy link
Member Author

Can this release be published to Nuget now that it's all done?

Yep, we'll do an update today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants