-
Notifications
You must be signed in to change notification settings - Fork 140
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
SNOW-834781: Can we remove log4net and delegate logging to library consumers #204
Comments
Removing several depedencies fixed several errors when used in .NET Core 3.+ self-contained app. When So I forked the repo and made this change and all publish errors has been resolved :). This was my change.
For now, I am keeping a Thanks, // @rdagumampan |
I highly recommend removing log4net. A simple strategy is this:
In addition to a singleton, app could also check app.config for logger configuration. This bit is less relevant for .NET Core. Moreover, if the user hasn't set a custom logger, the current functionality could be preserved "automagically" by scanning for the existence of the log4net driver assembly adjacent to the core assembly. If it finds the log4net driver assembly, load it using reflection and hook up the log4net logger class. That way, all an existing user would be required to do is to simply add a reference to the new package. Moreover, the log4net assembly could even be included by default in the existing nuget package which with the reflection scenario would allow users to update without any breaking changes. However, customers that don't need/want the log4net driver could remove it from their project references and then implement their own custom logger by deriving from the base class and hooking it up via config / singleton / whatever. |
This library should use Microsoft.Extensions.Logging to abstract the logging implementation like every other modern .net library. Don't invent your own. Using Microsoft.Extensions.Logging is the recommended way to allow consumers to choose which logging framework they want and avoid the unnecessary dependencies. |
hello and thank you all for your interest in this matter - also the suggestions are appreciated and welcome! also apologies for the long period without response. we'll take a look. |
Hi, how's the progress on this issue? It would be great if we could stop needing to add log4net to everything. |
hi - unfortunately i don't have any breakthroughs or closer estimations for implementation to share at this point, but will keep this thread updated once any new information becomes available. If you're (or any of you interested in this change) are already a Snowflake customer - please do reach out to your Account Team and let them know you need this enhancement. This might help getting traction and prioritizing over other requests. |
short update: work on this item (of removing log4net) started, no ETA at this point, will keep this ticket posted. |
Work is ongoing on #1057 |
Issue description
First thanks for working with this connector :)
I playing around with this connector and so far have been working nicely until I publish a self-contained .NET Core 3.1 CLI app. It throws up several errors and its largely due to dependencies to log4net.
From design point, I think its better if we delegate the responsibility of logging into the users of the library or let developers choose how to log by hooking to some event handlers or call backs. Right now, it looks like log4net has the heaviest baggage to carry on.
Configuration
.NET Core 3.0 CLI App
Developing on Windows 10
The text was updated successfully, but these errors were encountered: