Hi all,

maybe just another 'NH-User' opinion would be welcome.
>From my point of view, if the only change I have to do to satisfy NH logging
abstraction would
be just to specify 'logging implementation' in configuration in same way as
now
for proxy factory ('proxyfactory.factory_class') it's OK. Perfect would be
that without explicit specification, log4net is used.
Me, as user, I'm not willing to:
- make any configuration changes in existing lo4net conf
- make any changes in referenced assemblies (most people will still use
nh+log4net)
- to have _any_ dependency of nhcore on nhcontrib (I always take nhcontrib
as 'optional' package I don't need when not using nh.search/2nd level cache
providers etc)

Maybe I did not understand you correctly but from:
'4 - In contrib, implement a Log4NetLoggerProvider :
NHibernate.Logging.ILogger that simply is a wrapper over the log4net
implementation.'
It seems that for using nh+log4net in 'old way' I should also include
assembly with Log4NetLoggerProvider from NH.contrib, right ?

If logging abstraction in nhcore can be done with minimal impact for user
and for existing configurations
then I don't see any pain.
Otherwise it is.

Seems like we need something like sl4j in .NET :))

Thanks,
Jozef


2009/3/14 Sidar Ok <[email protected]>

> Hi Folks,
>
> I know this was discussed before :
> http://groups.google.com/group/nhibernate-development/browse_thread/thread/cdfddb3b63307dab/661d2b44a2100f9astarted
>  by Brian Chavez.
>
> As far as I can see in the trunk and in JIRA, there is no patch provided
> and it has been quite a time after the last message. Now I am willing to put
> some work in here to provide a patch, if it is OK.
>
> So here is my proposal step by step, let me know if it makes sense :
>
> 1 - Extract a new interface, called NHibernate.Logging.ILogger . This
> interface will abstract 2 used versions of GetLogger(Type) and
> GetLogger(string).
> 2 - Put this behind a service locator and change all references to logger
> to use this service locator instead, e.g :
> ServiceLocator.Get<NHibernate.Logging.ILogger>(typeof(PocoInstantiator))
> 3 - Remove all the assembly dependencies to log4net from the core and move
> it to contrib (they might stay in tests though for convenience).
> 4 - In contrib, implement a Log4NetLoggerProvider :
> NHibernate.Logging.ILogger that simply is a wrapper over the log4net
> implementation.
>
> In contrib we can also provide wrappers for NLog or EL Logging App Block.
> So this will be a step forward to have NH to be dependent only .NET FW by
> eliminating a hard dependency on log4net.
>
> Thoughts ?
>
> --
> Sidar Ok
>
> http://www.sidarok.com
> http://www.twitter.com/sidarok
>
>


-- 
Jozef

Reply via email to