You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Stefano Bagnara <ap...@bago.org> on 2008/05/12 11:04:53 UTC

[jSieve] why Logger class?

Hi all,

I see jSieve include a static class used to lookup the common logger:
http://svn.apache.org/repos/asf/james/jsieve/trunk/src/main/java/org/apache/jsieve/Logger.java

This is a singleton and return a commons-logging Log object.
Every class uses "Logger.getLog()" to get a common-logging logger 
instance so every class already depends on commons-logging.

What are the advantages of this class over the direct use of 
commons.logging LogFactory ?

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: [jSieve] why Logger class?

Posted by Robert Burrell Donkin <ro...@gmail.com>.
On Mon, May 12, 2008 at 6:49 PM, Stefano Bagnara <ap...@bago.org> wrote:
> Robert Burrell Donkin ha scritto:
>
> >
> > On Mon, May 12, 2008 at 2:54 PM, Stefano Bagnara <ap...@bago.org> wrote:

<snip>

> > > > all the singletons should really be replaced by IoC but that would
> > > > require some effort and entail some risk
> > > >
> > > >
> > >  +1
> > >
> > >  Should we add a JIRA issue for the next releases, so we are better
> aware of
> > > this?
> > >
> >
> > should be an existing IoC task: just include it as a subtask
> >
>
>  There is https://issues.apache.org/jira/browse/JSIEVE-16 but it is marked
> as resolved so I didn't find it in my searches.
>  Can we simply reopen it and remove the "affect version 0.2" so it will not
> show up in 0.2 changelog/openissues but we will have it in the roadmap?

fine by me

- robert

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: [jSieve] why Logger class?

Posted by Stefano Bagnara <ap...@bago.org>.
Robert Burrell Donkin ha scritto:
> On Mon, May 12, 2008 at 2:54 PM, Stefano Bagnara <ap...@bago.org> wrote:
>> Robert Burrell Donkin ha scritto:
>>> On Mon, May 12, 2008 at 10:04 AM, Stefano Bagnara <ap...@bago.org> wrote:
>>>>  What are the advantages of this class over the direct use of
>>>> commons.logging LogFactory ?
>>>>
>>> it allows the shared log instance can be set
>>>
>>  I'm not a commons-logging expert, but can't this be already done by using
>> commons-logging specific implementation configurations even if each class
>> directly calls the LogFactory.getLog() method?
> 
> that's not easy to do programmatically: this way is not how i would
> have done it but is not unreasonable.

ok, let's delay this until the IoC change is there.

>>> all the singletons should really be replaced by IoC but that would
>>> require some effort and entail some risk
>>>
>>  +1
>>
>>  Should we add a JIRA issue for the next releases, so we are better aware of
>> this?
> 
> should be an existing IoC task: just include it as a subtask

There is https://issues.apache.org/jira/browse/JSIEVE-16 but it is 
marked as resolved so I didn't find it in my searches.
Can we simply reopen it and remove the "affect version 0.2" so it will 
not show up in 0.2 changelog/openissues but we will have it in the roadmap?

Stefano




---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: [jSieve] why Logger class?

Posted by Robert Burrell Donkin <ro...@gmail.com>.
On Mon, May 12, 2008 at 2:54 PM, Stefano Bagnara <ap...@bago.org> wrote:
> Robert Burrell Donkin ha scritto:
>
>
> > On Mon, May 12, 2008 at 10:04 AM, Stefano Bagnara <ap...@bago.org> wrote:
> >
> > > Hi all,
> > >
> > >  I see jSieve include a static class used to lookup the common logger:
> > >
> > >
> http://svn.apache.org/repos/asf/james/jsieve/trunk/src/main/java/org/apache/jsieve/Logger.java
> > >
> > >  This is a singleton and return a commons-logging Log object.
> > >  Every class uses "Logger.getLog()" to get a common-logging logger
> instance
> > > so every class already depends on commons-logging.
> > >
> > >  What are the advantages of this class over the direct use of
> > > commons.logging LogFactory ?
> > >
> >
> > it allows the shared log instance can be set
> >
>
>  I'm not a commons-logging expert, but can't this be already done by using
> commons-logging specific implementation configurations even if each class
> directly calls the LogFactory.getLog() method?

that's not easy to do programmatically: this way is not how i would
have done it but is not unreasonable.

> > all the singletons should really be replaced by IoC but that would
> > require some effort and entail some risk
> >
>
>  +1
>
>  Should we add a JIRA issue for the next releases, so we are better aware of
> this?

should be an existing IoC task: just include it as a subtask

- robert

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: [jSieve] why Logger class?

Posted by Stefano Bagnara <ap...@bago.org>.
Robert Burrell Donkin ha scritto:
> On Mon, May 12, 2008 at 10:04 AM, Stefano Bagnara <ap...@bago.org> wrote:
>> Hi all,
>>
>>  I see jSieve include a static class used to lookup the common logger:
>>
>> http://svn.apache.org/repos/asf/james/jsieve/trunk/src/main/java/org/apache/jsieve/Logger.java
>>
>>  This is a singleton and return a commons-logging Log object.
>>  Every class uses "Logger.getLog()" to get a common-logging logger instance
>> so every class already depends on commons-logging.
>>
>>  What are the advantages of this class over the direct use of
>> commons.logging LogFactory ?
> 
> it allows the shared log instance can be set

I'm not a commons-logging expert, but can't this be already done by 
using commons-logging specific implementation configurations even if 
each class directly calls the LogFactory.getLog() method?

> all the singletons should really be replaced by IoC but that would
> require some effort and entail some risk

+1

Should we add a JIRA issue for the next releases, so we are better aware 
of this?

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: [jSieve] why Logger class?

Posted by Robert Burrell Donkin <ro...@gmail.com>.
On Mon, May 12, 2008 at 10:04 AM, Stefano Bagnara <ap...@bago.org> wrote:
> Hi all,
>
>  I see jSieve include a static class used to lookup the common logger:
>
> http://svn.apache.org/repos/asf/james/jsieve/trunk/src/main/java/org/apache/jsieve/Logger.java
>
>  This is a singleton and return a commons-logging Log object.
>  Every class uses "Logger.getLog()" to get a common-logging logger instance
> so every class already depends on commons-logging.
>
>  What are the advantages of this class over the direct use of
> commons.logging LogFactory ?

it allows the shared log instance can be set

all the singletons should really be replaced by IoC but that would
require some effort and entail some risk

- robert

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org