You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Dennis Sosnoski <dm...@sosnoski.com> on 2006/05/04 14:25:10 UTC

[Axis2] Log (mis)use?

In many places in the code I see non-static log instances being created, 
using "LogFactory.getLog(getClass())". The usage pattern I've seen in 
the past is to create a static log instance for the class, since AFAIK 
the logging options will be the same for all instances of a class and 
the creation of a separate log instance for each instance of the class 
represents unnecessary overhead. Is this log-per-class-instance approach 
a deliberate change in Axis2, or should static log instances be used?

  - Dennis

-- 
Dennis M. Sosnoski
SOA, Web Services, and XML
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-296-6194 - Wellington, NZ +64-4-298-6117


Re: [Axis2] Log (mis)use?

Posted by Davanum Srinivas <da...@gmail.com>.
Fixed.

thanks,
dims

On 5/4/06, Dennis Sosnoski <dm...@sosnoski.com> wrote:
> A quick grep found 116 instances under axis2/modules (and another 13 in
> axiom), so fixes may take a while unless someone can write a clever script.
>
>   - Dennis
>
> Davanum Srinivas wrote:
>
> > Dennis,
> >
> > i fixed a few since last week. Please go ahead and fix them when u get
> > a chance. We'll keep a look out for them from now on.
> >
> > thanks,
> > dims
> >
> > On 5/4/06, Dennis Sosnoski <dm...@sosnoski.com> wrote:
> >
> >> In many places in the code I see non-static log instances being created,
> >> using "LogFactory.getLog(getClass())". The usage pattern I've seen in
> >> the past is to create a static log instance for the class, since AFAIK
> >> the logging options will be the same for all instances of a class and
> >> the creation of a separate log instance for each instance of the class
> >> represents unnecessary overhead. Is this log-per-class-instance approach
> >> a deliberate change in Axis2, or should static log instances be used?
> >>
> >>   - Dennis
> >>
> >> --
> >> Dennis M. Sosnoski
> >> SOA, Web Services, and XML
> >> Training and Consulting
> >> http://www.sosnoski.com - http://www.sosnoski.co.nz
> >> Seattle, WA +1-425-296-6194 - Wellington, NZ +64-4-298-6117
> >>
> >>
> >
> >
> > --
> > Davanum Srinivas : http://wso2.com/blogs/
> >
>


--
Davanum Srinivas : http://wso2.com/blogs/

Re: [Axis2] Log (mis)use?

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
A quick grep found 116 instances under axis2/modules (and another 13 in 
axiom), so fixes may take a while unless someone can write a clever script.

  - Dennis

Davanum Srinivas wrote:

> Dennis,
>
> i fixed a few since last week. Please go ahead and fix them when u get
> a chance. We'll keep a look out for them from now on.
>
> thanks,
> dims
>
> On 5/4/06, Dennis Sosnoski <dm...@sosnoski.com> wrote:
>
>> In many places in the code I see non-static log instances being created,
>> using "LogFactory.getLog(getClass())". The usage pattern I've seen in
>> the past is to create a static log instance for the class, since AFAIK
>> the logging options will be the same for all instances of a class and
>> the creation of a separate log instance for each instance of the class
>> represents unnecessary overhead. Is this log-per-class-instance approach
>> a deliberate change in Axis2, or should static log instances be used?
>>
>>   - Dennis
>>
>> -- 
>> Dennis M. Sosnoski
>> SOA, Web Services, and XML
>> Training and Consulting
>> http://www.sosnoski.com - http://www.sosnoski.co.nz
>> Seattle, WA +1-425-296-6194 - Wellington, NZ +64-4-298-6117
>>
>>
>
>
> -- 
> Davanum Srinivas : http://wso2.com/blogs/
>

Re: [Axis2] Log (mis)use?

Posted by Davanum Srinivas <da...@gmail.com>.
Dennis,

i fixed a few since last week. Please go ahead and fix them when u get
a chance. We'll keep a look out for them from now on.

thanks,
dims

On 5/4/06, Dennis Sosnoski <dm...@sosnoski.com> wrote:
> In many places in the code I see non-static log instances being created,
> using "LogFactory.getLog(getClass())". The usage pattern I've seen in
> the past is to create a static log instance for the class, since AFAIK
> the logging options will be the same for all instances of a class and
> the creation of a separate log instance for each instance of the class
> represents unnecessary overhead. Is this log-per-class-instance approach
> a deliberate change in Axis2, or should static log instances be used?
>
>   - Dennis
>
> --
> Dennis M. Sosnoski
> SOA, Web Services, and XML
> Training and Consulting
> http://www.sosnoski.com - http://www.sosnoski.co.nz
> Seattle, WA +1-425-296-6194 - Wellington, NZ +64-4-298-6117
>
>


--
Davanum Srinivas : http://wso2.com/blogs/