You can include using xml one deep, as was once suggested to me but there are HUGE limitations on this. I ended up writing a pearl script to do what I needed. The Jakarta's Commons Configuration could have probably done what I wanted but I chose not to even look into it given what I had to work with. I will however be going back to taking a look at it shortly because of our needs.
We have over 100 groups that need the ability to define their own loggers and appenders and rather then use pearl to grab each chunk and write one huge configuration file I think I will end up looking in to JCC. I would suggest not blowing it off even if you have your own custom configuration. -----Original Message----- From: Hein Meling [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 09, 2005 2:45 PM To: Log4J Users List Subject: Re: Inheriting configuration Thanks for the suggestion. However, I would prefer a solution that does not rely on additional jar files. My system alread got a home built configuration framework, and I'm currently not looking to replace it, albeit it was tempting once I discovered all the nice features of the Commons Configuration. Hein Moran Ben-David wrote: > Hello Hein, > > I am doing a similar thing that you are looking for. That is, I am using > multiple files to create a single configuration for log4j. The way I do > this is to > > 1. create a set of Properties > 2. use the PropertiesConfigurator to initialize log4j. > > To do step 1, I am using Jakarta's Commons Configuration. That allows me to > get a single "Configuration" out of many files. This module allows you to > load from many types of sources: JDBC, Xml, .properties file, etc. You will > most likely need to use a CompositeConfiguration to decide in runtime that > you need the extra xml file. > > Hope that helps, > moran ben-david > www.place-base.com > > >>-----Original Message----- >>From: Hein Meling [mailto:[EMAIL PROTECTED] >>Sent: Tuesday, August 09, 2005 7:25 AM >>To: Log4J Users List >>Subject: Inheriting configuration >> >>Hi >> >>Is it possible to inherit (import) configuration from one log4j-main.xml >>to another? >> >>Say for example, you want to define a common set of appenders, and also >>some common loggers, but for some subproject you want to define specific >>loggers only for that subproject's log4j-subproj.xml file. >> >>If a particular logger is define in both log4j-*.xml files, I assume the >>subproject version would override the loggers in log4j-main.xml. >> >>Is this possible? If so, how can I do it? >> >>I'm currently using log4j v1.3alpha3. Eagerly awaiting alpha7 ;-) >> >>Thanks, >> >>Hein > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
