logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 47960] appender-ref children in appender element
Date Thu, 08 Oct 2009 13:37:55 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=47960

--- Comment #1 from Curt Arnold <carnold@apache.org> 2009-10-08 06:37:52 PDT ---
I wrote this reply after a similar posting on log4j-user after a related post. 
However, I can't find my reply in the archive, so maybe it did not get there:


On Sep 29, 2009, at 8:56 PM, Curt Arnold wrote:

I believe it is only used by AsyncAppender and similar appenders that
encapsulate another appender.

<appender class="org.apache.log4j.AsyncAppender">
    <appender-ref ref="console"/>
</appender>

If you want to reuse configuration fragments, you can use the external entity
facility of XML to include any arbitrary XML content from another file.  It
doesn't work with earlier log4j's, but should work with anything from the last
few years.

<!DOCTYPE log4j:configuration [
<!ENTITY boilerplate SYSTEM 'boilerplate.xml'>
]>
<log4j:configuration....>
&boilerplate;
</log4j:configuration>

The following are new comments:


There are multiple places where the DOMConfiguration expects to resolve a
appender name and get a single Appender back.  Rewriting DOMConfigurator to
handle an array of appenders or some similar structure would be a significant
modification and may pose compatibility issues.

If it were to be done, the easiest way to implement would be to create a
CompositeAppender that would delegate to the nested appenders.  However, except
for the magic of interpreting a blank class name as CompositeAdapter,  you
could accomplish the same objective by just writing the CompositeAdapter and
specifying its class name.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


Mime
View raw message