Travix-International / Hystrix.Dotnet

A combination of circuit breaker and timeout. The .net version of the open source Hystrix library built by Netflix.
https://travix-international.github.io/Hystrix.Dotnet/
MIT License
95 stars 16 forks source link

Remove depedency to Log4Net #4

Closed bhugot closed 7 years ago

bhugot commented 7 years ago

Hi,

Could you please remove dependency to Log4Net, it's sad we should use Log4Net if we want to use something else to log. Especially you don't have that much log in your solution.

Thanks

markvincze commented 7 years ago

Hey @bhugot,

I agree it's a bit inconvenient having to bring in a logging library just in order to use Hystrix when your actual application might be using a different logging library altogether.

What I can think of is instead of logging with log4net directly, just create our own IHystrixLogger interface, use that to log inside Hystrix, and have a default implementation that just swallows the log messages (or writes to the console) Then the users of Hystrix could provide an actual implementation of this interface (for example provide the type in the configuration), to specify how they want to log. And of course we can implement specific loggers ourselves for some logging libraries (like log4net) in extension packages. @JorritSalverda, what do you think?

JorritSalverda commented 7 years ago

@markvincze currently we don't collect those logs anyway.

Indeed we need to move to a logging abstraction. Maybe https://github.com/damianh/LibLog is useful for that or otherwise what you suggest.

markvincze commented 7 years ago

@JorritSalverda Oh, nice, I didn't know about LibLog, it seems to be exactly what I had in mind. 👍