I am trying to configure log4j using xml. I am using log4j1.2.13.jar and apache-log4j-extras-1.2.17.jar.
below is the xml.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="R" class="org.apache.log4j.rolling.RollingFileAppender">
<param name="File" value="${LOG_FILE}"/>
<param name="append" value="true"/>
<param name="encoding" value="UTF-8"/>
<layout class="org.apache.log4j.TTCCLayout">
<param name="ContextPrinting" value="true"/>
<param name="ThreadPrinting" value="true"/>
<param name="DateFormat" value="MM/dd/yyyy HH:mm:ss"/>
</layout>
<rollingPolicy class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
<param name="FileNamePattern" value="${LOG_FILE}%i.gz" />
</rollingPolicy>
<triggeringPolicy class="org.apache.log4j.rolling.SizeBasedTriggeringPolicy">
<param name="MaxFileSize" value="${LOG_FILESIZE_LIMIT}"/>
</triggeringPolicy>
</appender>
<root>
<priority value ="DEBUG"/>
<appender-ref ref="R"/>
</root>
</log4j:configuration>
But its not generating logs for the project. Below are the errors ::
log4j:WARN Continuable parsing error 15 and column 78
log4j:WARN Element type "rollingPolicy" must be declared.
log4j:WARN Continuable parsing error 18 and column 79
log4j:WARN Element type "triggeringPolicy" must be declared.
log4j:WARN Continuable parsing error 21 and column 15
log4j:WARN The content of element type "appender" must match "(errorHandler?,param*,layout?,filter*,appender-ref*)".
log4j:WARN Please set a rolling policy for the RollingFileAppender named 'R'
level::: 7
log4j:ERROR No output stream or file set for the appender named [R].
Please help me to solve the issue.