logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Schuweiler, Joel J." <Schuweiler.J...@mayo.edu>
Subject RE: Modularizing XML configuration files (Re: Error using NullAppender in <root>)
Date Fri, 22 Jul 2005 14:43:05 GMT
So here is a silly question, how would I go about nesting them?

For ex.

Log4j.xml includes an appender.xml and a logger.xml

And appender.xml includes a bunch of other xml files for custom appenders for different groups
of people.


As far as I can tell I would need to use a doctype in appender.xml but this as far as I can
tell is not legal? 

-----Original Message-----
From: Curt Arnold [mailto:carnold@apache.org] 
Sent: Wednesday, June 29, 2005 10:21 AM
To: Log4J Users List
Subject: Modularizing XML configuration files (Re: Error using NullAppender in <root>)


On Jun 29, 2005, at 9:36 AM, Schuweiler, Joel J. wrote:

> Well I'm looking at 3 appenders and 3 loggers for each project. I  
> have roughly 200 projects. I am looking for any idea's on how to  
> best scale my log4j.xml file to handle this. I bought the  
> commercial manual but I don't see anything mentioned about how I  
> could go about making mini configurations and include them all into  
> the log4j.xml file. I am open to any suggestions!

You can use XML external entities to modularize any XML file  
(consider it the standard XML equivalent of include files).  Earlier  
versions of log4j didn't implement XML parsing correctly so they lost  
the ability to use relative path names, but they should work with the  
current CVS HEAD.

<?xml version="1.0"?>
<!DOCTYPE log4j:configuration [
<!ENTITY section1 SYSTEM 'section1.ent'>
<!ENTITY section2 SYSTEM 'section2.ent'>
]>
<log4j:configuration xmlns:log4j="...">
     <!--  expand section1.ent here -->
     &section1;
     <!--  expand section1.ent here -->
     &section2;
</log4j:configuration>

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

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


Mime
View raw message