https://github.com/nhibernate/nhibernate-core/pull/15
It was not merged at the time because there was some compatibility
concerns since if log4net was installed in the GAC, NHibernate would
now suddenly find this. Someone mentioned delaying it until the next
major version.
Since we are now aiming for 3.3, perhaps we should try to make a
decision on this.
Since we are only trying to load log4net if no other logging framework
has been configured, I think the proposed change would be ok. Also,
before the introduction of the logging abstraction, log4net would
always be loaded even when not configured.
/Oskar
Yes.
To paraphrase Fabio, the new behavior will be:
"If no logging system is configured and there isn't log4net in the
deploy folder OR IN THE GAC the NoLoggingLogger is used.."
If we want, I guess we could make even log4net require explicit
activation using the "nhibernate-logger" appsetting. Then you would
never get any logging unless you provide a "nhibernate-logger"
setting.
/Oskar
If we want, I guess we could make even log4net require explicit
activation using the "nhibernate-logger" appsetting. Then you would
never get any logging unless you provide a "nhibernate-logger"
setting.
nhibernate-logging missing or empty
Use Nologging. Do not attempt to load log4net, even if present in
the deploy directory.
nhibernate-logging set to full name and assembly of a class.
Attempt to use that with System.Type.GetType("") and
Activator.CreateInstance() which will find it in either GAC or deploy
directory.
nhibernate-logging equal to "log4net"
Attempt to load log4net using Assembly.Load("log4net"), which will
find it in either the GAC or deploy directory.
This is to simplify and reduce impact of breaking change for those
who just want to keep using log4net.
/Oskar
2012/1/24 Stephen Bohlen <sbo...@gmail.com>:
Before the introduction of the loggin abstraction when log4net was
required, it would have been loaded from the GAC if available right?
When the change was made it would then mean that it was no longer
enough to have it in GAC, i.e. a breaking change (which I don't seem
to find in the release notes).
If we don't want to use Assembly.Load(), other alternatives:
1) Find the path of NHibernate.dll and expect log4net.dll to be in the
same folder. Though NHibernate.dll may be in the GAC.
2) Fix the code to properly handle semicolons in RelativeSearchPath,
which can occur according to the documentation.
/Oskar
Hi Rafał,
Thanks for working on this. However, I see some issues with this
patch. I agree with you that logging, if used, should be initialized
first, but I also fear that this behaviour could lead to strange and
difficult to debug problems, where it may not be obvious why logging
doesn't work.
In fact, when I think about it I have to wonder if this special case
automatic-but-only-if-in-a-specific-directory loading of log4net is
really necessary. Perhaps we should rip that out as a breaking change
in the upcoming 3.3 and *require* even log4net users to set the
nhibernate-logging application setting. It's certainly not difficult.
To be clear: My idea is to *keep* the log4net logger factory to make
log4net use easy, but *require* setting nhibernate-logging="log4net"
to turn it on. In this case, we wouldn't care where the assembly is
located, as long as the runtime can find it.
/Oskar
2012/2/8 Rafał Kłys <rafalklys at gmail.com>: