SNOW-1676298: Expose the possibility to disable logging completely (for .NET Native AOT) #1028
Labels
duplicate
feature
status-triage_done
Initial triage done, will be further handled by the driver team
As of today, the constructor for SnowflakeDbConnection calls a SFLoggerFactory.GetLogger() method which in turn calls a GetLogger() method in a LogManager class from the log4net dependency.
That log4net method calls
Assembly.GetCallingAssembly()
which is not supported when running in native AOT.I see that
SFLoggerFactory
hasenableLogger
anddisableLogger
methods. However, SFLoggerFactory is a private class so we cannot invoke them. I see no other way of telling the package to use SFLoggerEmptyImpl.Ideally, the driver would use the ILogger interface, instead of log4net, and I see others have requested that as well.
But besides that, I think that. at the very least, the package should allow us to not use any logging if we so desire. Even if one tries to do so via configuration, the SnowflakeDbConnection will always call GetLogger(). In my case, this makes it impractical (*) to use .NET Native AOT.
(*) The only way I can achieve that is with a reflection dirty-hack, using reflection methods supported in native AOT, to invoke the private method.
The text was updated successfully, but these errors were encountered: