logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bender Heri <hben...@ergonomics.ch>
Subject Appender-ref within appender tag
Date Tue, 29 Sep 2009 11:54:17 GMT
Hi all

The appender tag of xml configuration allows formally to be like that:

    <appender name="STANDARD_APPENDERS" class="">
        <appender-ref ref="CONSOLE.ERR"/>
        <appender-ref ref="CONSOLE.OUT"/>
        <appender-ref ref="FILE"/>

According to DTD:

<!ELEMENT appender (errorHandler?, param*, layout?, filter*, appender-ref*)>
<!ATTLIST appender
  name          ID      #REQUIRED
  class         CDATA   #REQUIRED

But: how to use this feature?

I would like to use one ref to this STANDARD_APPENDERS in my logger definitions, since I have
a lot of finetuned logger definitions. But my development environment (eclipse) likes the
Console-Appender, whereas the server does not like it. If I can use such a sampler appender
I would have to change the included appenders only at one location.

Problem is: the class-Attribute of appender element is mandatory. But what to write therein?
Left blank (like shown above) leads to a ClassNotFountException. Omitting the attribute says

log4j:WARN Attribute "class" is required and must be specified for element type "appender".
Followed by a ClassNotFountException again.

The log4j manual has no hints about this feature.

Any ideas?

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

View raw message