You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Curt Arnold <ca...@apache.org> on 2005/06/29 17:20:33 UTC

Modularizing XML configuration files (Re: Error using NullAppender in )

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