Environment.LogManager.GetLogger.....

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

> So do you mean instead of a SL we need to use something like
> Environment.GetLogger<T> and Environment.GetLogger(string) (1)? I proposed
> the service locator because the current usage is like this as you know:
>
> protected static readonly ILog log =
> LogManager.GetLogger(typeof(AbstractBatcher));
>
> So instead of using this static member we are going to use (1). Is my
> understanding correct ? Environment seems a better place agreed, does that
> mean that we should put custom configuration for it in place ?
>
> Also it might be valuable to have a NullLoger as default like
> NullByteCodeProvider ?
>
>
> On Sat, Mar 14, 2009 at 3:35 AM, Fabio Maulo <[email protected]> wrote:
>
>> Logger should be set before any other operation (as byte code). The
>> instance should be find trough Environment.
>>
>> 2009/3/13 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
>>>
>>>
>>
>>
>> --
>> Fabio Maulo
>>
>
>
>
> --
> Sidar Ok
>
> http://www.sidarok.com
> http://www.twitter.com/sidarok
>
>


-- 
Fabio Maulo

Reply via email to