citrix / ShareFile-NET

C# library for accessing ShareFile V3 API
MIT License
36 stars 26 forks source link

How do you use a DI logger from Core? #39

Closed pduer closed 4 years ago

pduer commented 4 years ago

I see how the line: configuration.Logger = new DefaultLoggingProvider(); works

But what if I want to provide my standard logger that I have DI to the Sharefile Client?

EmmaGCitrix commented 4 years ago

Can you modify your logger to implement ShareFile.Api.Client.Logging.ILogger? You could then pass in your logger like configuration.Logger = customLogger;

Alternatively, you could write some wrapper that implements ShareFile.Api.Client.Logging.ILogger and proxies calls to your custom logger. Then pass it in like above, configuration.Logger = wrapper;

pduer commented 4 years ago

Yeah, after I typed this out I just caught on to that. I need to implment the Sharefile ILogger.

I did that and it works good.