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/09/04 08:16:23 UTC

Wrote a layered configurator for log4j-1.2

Hi all,

I've wanted a "meta-configurator" for a while now, but I couldn't find
anything in the source code that filled that niche.  So I wrote my
own; there's a blog post here:

http://tersesystems.com/post/9700076.jhtml

and the zip file is here:

http://tersesystems.com/code/layered-configurator/layered-configurator.zip

Please let me know if there's anything I can improve or if I've gotten
something horribly wrong.  I'd love to know now, so I can fix it or
point people to a better solution...

Will.

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


Re: Wrote a layered configurator for log4j-1.2

Posted by Will Sargent <wi...@gmail.com>.
> > I also wonder if you are proposing to donate the code the Apache Logging Log4j
> > project?  Theoretically, it could be yet another Log4j companion project.
> >  Maybe we could create a "configuration" companion to encompass useful
> > configuration code.  There could even be code to utilize other more full
> > featured configuration projects such as commons-configuration or provide
> > Spring Application Context integration.  Just a thought.

As to working into commons-configuration and the Spring Application
Context system...

I initially started off with the idea that I'd like to configure Log4J
using Spring, since that's what I use for most environment-specific
configs.  However, if something goes wrong in Spring, I'd it to tell
me what happened using Log4J.  So there's a vicious cycle if something
goes wrong; Spring depends on Log4J depends on Spring.  Ultimately it
was simpler and clearer just to make it depend on system properties
for now, with the option of expanding it later.

Will.

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


Re: Wrote a layered configurator for log4j-1.2

Posted by Will Sargent <wi...@gmail.com>.
On 9/4/07, Jacob Kjome <ho...@visi.com> wrote:
> Interesting.  What's the syntax to import an external config file into a Log4j
> XML config file?  Maybe I missed it, but I think you only had a Log4j
> properties file example.

log4j-config.properties is actually not a properties file in the usual
sense.  It's a list of config files to read in, seperated by newlines.
 I should probably rename it to log4j.config, and then
it'll be more obvious.

> I also wonder if you are proposing to donate the code the Apache Logging Log4j
> project?  Theoretically, it could be yet another Log4j companion project.
>  Maybe we could create a "configuration" companion to encompass useful
> configuration code.  There could even be code to utilize other more full
> featured configuration projects such as commons-configuration or provide
> Spring Application Context integration.  Just a thought.

I'm happy to donate the code to Log4J -- I put it under the Apache
license and I've made sure it's commented.  It really is just a custom
configurator (albeit one that "configurates" configurators) so I think
it should fit nicely into Log4J itself, subject to modifications and
code style...

Will.

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


Re: Wrote a layered configurator for log4j-1.2

Posted by Jacob Kjome <ho...@visi.com>.
Interesting.  What's the syntax to import an external config file into a Log4j 
XML config file?  Maybe I missed it, but I think you only had a Log4j 
properties file example.

I also wonder if you are proposing to donate the code the Apache Logging Log4j 
project?  Theoretically, it could be yet another Log4j companion project. 
 Maybe we could create a "configuration" companion to encompass useful 
configuration code.  There could even be code to utilize other more full 
featured configuration projects such as commons-configuration or provide 
Spring Application Context integration.  Just a thought.


Jake

On Mon, 3 Sep 2007 23:16:23 -0700
  "Will Sargent" <wi...@gmail.com> wrote:
> Hi all,
> 
> I've wanted a "meta-configurator" for a while now, but I couldn't find
> anything in the source code that filled that niche.  So I wrote my
> own; there's a blog post here:
> 
> http://tersesystems.com/post/9700076.jhtml
> 
> and the zip file is here:
> 
> http://tersesystems.com/code/layered-configurator/layered-configurator.zip
> 
> Please let me know if there's anything I can improve or if I've gotten
> something horribly wrong.  I'd love to know now, so I can fix it or
> point people to a better solution...
> 
> Will.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-dev-help@logging.apache.org
> 
> 


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