You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Will Sargent <wi...@gmail.com> on 2007/11/05 21:55:06 UTC

Steps for making a code contribution?

Hi all,

I have a layered configurator that I'd like to contribute to log4j, 
either as a companion or in the core code.  I've read through the wiki on

http://wiki.apache.org/logging-log4j/ContributingCode

and a description and zip of the code is currently here:

http://tersesystems.com/code/index?overview=layered_configurator
http://tersesystems.com/code/layered-configurator/layered-configurator.zip

It's not in patch format for clarity, since it's all new classes.  I can 
package it as a patch easily enough.

I'd like a response to tell me if this is of submittable quality, and if 
not, what changes need to be made? 

Will.

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


Re: Steps for making a code contribution?

Posted by Will Sargent <wi...@gmail.com>.
> Collaborative software development is a key tenet of the ASF and code
> that is developed in isolation may need to come through the
> incubator.  Ideally, new code contributions start with a "hey, I was
> thinking about ...." message and some initial discussion and then
> maybe a proof of concept before starting something in a sandbox to
> see it develop and talk through the design issues.

> It looks like you have a working version documented and packaged up
> on the tersesystems.com site.  Is the code basically in maintenance
> mode or do you anticipate further development?  How do you see others
> contributing to the further development of the code?

I have a few, mostly stylistic concerns with the code right now,
mostly related to future enhancements or assumptions I've made in the
code.

The first is in the ConfiguratorFactory -- I return either a DOM or a
Property configurator based on the suffix, and throw an
UnsupportedOperationException if not found.  I don't know what the
correct behaviour is, but I'd like it to fail / fall through in a
manner consistent with the rest of the code, and be able to handle new
configurators without code modifications.  This may be reaching,
though.  It could also use more javadoc.

The second is that the LayeredConfigurator only implements the bare
minimum of doConfigure methods, although it does adhere to the
Configurator interface.  If other classes depend on the
implementation, this class may not be able to work as effectively.

I don't really understand LoggerRepository, and so I've copied what I
saw other code doing.  I don't know how big a deal this is.

substituteParameter calls
OptionConverter.getSystemProperty(parameterName, "") directly.  It'd
be nice if there were some way to define where substitution properties
came from, although the method is intentionally protected so
subclasses can change that behaviour.

Unit tests and integration tests are local to the system, and haven't
been integrated into log4j-core.

Otherwise, I'm pretty happy with it as it stands.

> Please look through the IP clearance process at http://
> incubator.apache.org and see if it raises any issues.  The scope of
> the contribution appears to be much smaller than an incubated
> project, but some of the same questions should be answered.

Will do.

> I did take a scan of the code, it does appear to conform to ASF
> source header policy (http://www.apache.org/legal/src-headers.html).
>
> It also stated that it was based on log4j 1.3.  log4j 1.3 development
> has been abandoned.  I assume that it could be modified to work with
> log4j 1.2, but maybe you already have some thoughts on that.  If it
> were to be accepted into the LS project, any release would need to
> target log4j 1.2.

Okay, that's an instance where the javadoc was unclear.  I was
specifically targeting JDK 1.3 syntax and made a note of this because
there are some features and tokenizers that would have made parsing
easier.  It actually targets log4j 1.2.15.

Will.

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


Re: Steps for making a code contribution?

Posted by Will Sargent <wi...@gmail.com>.
> The log4j built predates that and uses a different directory
> structure.  I think it is very unlikely that it would go directly
> into log4j itself.  Probably the most reasonable course of action is
> to check out the extras companion and work the classes into that
> build environment.  It would be fairly simple to remove all the rest
> of the stuff from extras to make just a layered configurator
> companion if that was the course of action.

Okay, I'll make a layered configurator companion...

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


Re: Steps for making a code contribution?

Posted by Curt Arnold <ca...@apache.org>.
On Nov 7, 2007, at 10:22 PM, Will Sargent wrote:

> Curt Arnold wrote:
>> I did take a scan of the code, it does appear to conform to ASF  
>> source header policy (http://www.apache.org/legal/src-headers.html).
>>
>> It also stated that it was based on log4j 1.3.  log4j 1.3  
>> development has been abandoned.  I assume that it could be  
>> modified to work with log4j 1.2, but maybe you already have some  
>> thoughts on that.  If it were to be accepted into the LS project,  
>> any release would need to target log4j 1.2.
>>
>> I'd suggest talking through these issues before posting the code  
>> to Bugzilla.
> I tweaked the ConfiguratorFactory so it will instantiate  
> Configurator objects based on their class.  Should be much more  
> maintainable.  Also wrote some more unit tests, and made sure  
> everything's working in log4j/trunk.
>
> I'm a bit confused about how the input, input/xml and resources  
> work in the test directory.  How does this all work?  Any  
> documentation I can look at?
>
> Will.
>

New code is following the Maven Standard Directory Layout (http:// 
maven.apache.org/guides/introduction/introduction-to-the-standard- 
directory-layout.html).   Basically everything that is in src/test/ 
resources is available through a getResource() or similar call.

The log4j built predates that and uses a different directory  
structure.  I think it is very unlikely that it would go directly  
into log4j itself.  Probably the most reasonable course of action is  
to check out the extras companion and work the classes into that  
build environment.  It would be fairly simple to remove all the rest  
of the stuff from extras to make just a layered configurator  
companion if that was the course of action.

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


Re: Steps for making a code contribution?

Posted by Will Sargent <wi...@gmail.com>.
Curt Arnold wrote:
> I did take a scan of the code, it does appear to conform to ASF source 
> header policy (http://www.apache.org/legal/src-headers.html).
>
> It also stated that it was based on log4j 1.3.  log4j 1.3 development 
> has been abandoned.  I assume that it could be modified to work with 
> log4j 1.2, but maybe you already have some thoughts on that.  If it 
> were to be accepted into the LS project, any release would need to 
> target log4j 1.2.
>
> I'd suggest talking through these issues before posting the code to 
> Bugzilla.
I tweaked the ConfiguratorFactory so it will instantiate Configurator 
objects based on their class.  Should be much more maintainable.  Also 
wrote some more unit tests, and made sure everything's working in 
log4j/trunk.

I'm a bit confused about how the input, input/xml and resources work in 
the test directory.  How does this all work?  Any documentation I can 
look at?

Will.

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


Re: Steps for making a code contribution?

Posted by Curt Arnold <ca...@apache.org>.
On Nov 5, 2007, at 2:55 PM, Will Sargent wrote:

> Hi all,
>
> I have a layered configurator that I'd like to contribute to log4j,  
> either as a companion or in the core code.  I've read through the  
> wiki on
>
> http://wiki.apache.org/logging-log4j/ContributingCode
>
> and a description and zip of the code is currently here:
>
> http://tersesystems.com/code/index?overview=layered_configurator
> http://tersesystems.com/code/layered-configurator/layered- 
> configurator.zip
>
> It's not in patch format for clarity, since it's all new classes.   
> I can package it as a patch easily enough.
>
> I'd like a response to tell me if this is of submittable quality,  
> and if not, what changes need to be made?
> Will.
>

The Wiki (and apparently other apache,.org sites) is not responding  
at the moment and I'm not familiar with the content of that page.   
The wiki is open for public editing and while it may or may not be  
useful, it does not necessarily reflect the opinions of the project  
(which should be on logging.apache.org).  Any definitive guide to  
contributing to Apache would be hosted on http://www.apache.org or  
http://incubator.apache.org.  Any Logging Services specific content  
should be on http://logging.apache.org and should mostly be links to  
the other sites.

Collaborative software development is a key tenet of the ASF and code  
that is developed in isolation may need to come through the  
incubator.  Ideally, new code contributions start with a "hey, I was  
thinking about ...." message and some initial discussion and then  
maybe a proof of concept before starting something in a sandbox to  
see it develop and talk through the design issues.

It looks like you have a working version documented and packaged up  
on the tersesystems.com site.  Is the code basically in maintenance  
mode or do you anticipate further development?  How do you see others  
contributing to the further development of the code?

Please look through the IP clearance process at http:// 
incubator.apache.org and see if it raises any issues.  The scope of  
the contribution appears to be much smaller than an incubated  
project, but some of the same questions should be answered.

I did take a scan of the code, it does appear to conform to ASF  
source header policy (http://www.apache.org/legal/src-headers.html).

It also stated that it was based on log4j 1.3.  log4j 1.3 development  
has been abandoned.  I assume that it could be modified to work with  
log4j 1.2, but maybe you already have some thoughts on that.  If it  
were to be accepted into the LS project, any release would need to  
target log4j 1.2.

I'd suggest talking through these issues before posting the code to  
Bugzilla.

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