On Sep 2, 2007, at 11:00 PM, Daniel Rossi wrote:

Hi there, ive been developing upon log4j alpha 1.3 for quite a while to use some new features. I believe it is now a dead branch. What am i suppose to be using, I need the new org.apache.log4j.rolling.RollingFileAppender package and the rolling policy for a project im working on which requires customised subclassed logging features. What can I use now to get the same features ?


The extras companion (http://logging.apache.org/log4j/companions/ extras) contains the org.apache.log4j.rolling.RollingFileAppender and related classed backported for log4j 1.2.x.

I believe now in eclipse my xml configs are broken aswell, something doesnt like my xml config setup, what exactly is it now ? Here is an example of my current one

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE configuration>

<configuration xmlns="http://logging.apache.org/";>
<appender name="TS000011-APP" class="org.apache.log4j.rolling.RollingFileAppender"> <rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy"> <param name="fileNamePattern" value="logs/stats/TS000011/Red5_% d{yyyyMMdd}.log"/>
                </rollingPolicy>

        <layout class="org.red5.server.logging.W3CLayout">
            <!--
            <param name="Fields"
                value="field1,field2,field3"/>
                -->
                <!--
            <param name="Delimiter"
                value="\t"/>
                -->
        </layout>
    </appender>
</configuration>

I get errors like

log4j:WARN Element type "configuration" must be declared.

Let me know


log4j 1.2 requests a validated parse of the configuration file and reports any validation errors to the console. However, any validation errors do not affect the configuration process. Since you did not specify any document type declaration, the parser has no access to any element definitions which will result in the message that you are seeing. To address this problem, start the document with:

<!DOCTYPE log4j:configuration SYSTEM 'log4j.dtd'>
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";>
   <appender...>
   ...
</log4j:configuration>

The URL for the DTD only has to end with log4j.dtd, their doesn't need to be anything at the URL as It will be resolved by the DOMConfiguration from a copy embedded in the jar file. The log4j.dtd is a bit weird that configuration element is namespace qualified (expects the log4j prefix and the jakarta URL), but interior elements don't have a prefix or namespace. Neither log4j 1.2 or 1.3 requested a namespace aware parse, so you could make up a namespace and not see the effects, but any migration tools may require that configuration files be namespace valid or use the established namespace.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to