autofac / Autofac.ServiceFabric

Autofac integration for Azure Service Fabric. Provides service factory implementations for Actors, Stateful Services and Stateless Services.
MIT License
26 stars 27 forks source link

Service proxy and logging #21

Closed artemkuzmyk closed 6 years ago

artemkuzmyk commented 6 years ago

Hi

I'm looking for a way to log all calls to Actors/Services methods through the service proxy. I want log all methods on client and server sides. Client side is easy to implement but I don't know how to do it on remote side with existed features.

It would be nice to return here IRegistrationBuilder and pass it to builder.RegisterActor method. So I can add some interceptor. https://github.com/autofac/Autofac.ServiceFabric/blob/9d6770ea9c1054b87399861950d6def32f5455eb/src/Autofac.Integration.ServiceFabric/RegistrationExtensions.cs#L54

https://github.com/autofac/Autofac.ServiceFabric/blob/79ea256e779f4f1406e5561c582f8e453a4f341d/src/Autofac.Integration.ServiceFabric/AutofacActorExtensions.cs#L46

The same for stateless and stateful services

What do you think?

alexmg commented 6 years ago

This sounds very similar to issue #20. As outlined in that issue, returning the IRegistrationBuilder is certainly something I could do, but I have some concerns about the registrations being broken if exposed. This does represent a second scenario where having access to the registration would be beneficial so I will certainly consider it.

alexmg commented 6 years ago

The RegisterActor, RegisterStatefulService and RegisterStatelessService methods now return an IRegistrationBuilder allowing for further configuration of the registration. This will be included in the next release.

pshrosbree commented 6 years ago

Could a preview version that includes this change be released to nuget.org?

artemkuzmyk commented 6 years ago

Cool, waiting for release!

alexmg commented 6 years ago

I have pushed a 1.1.0 package to NuGet.