Thenk you Jacob, everything works correctly. Kind Regards,
Antonio. 2009/2/20 Jacob Kjome <[email protected]> > You are using the older RollingFileAppender. You need to use the one in > the log4j-extras package... > > > > org.apache.log4j.rolling.RollingFileAppender > > > Jake > > > On Fri, 20 Feb 2009 19:22:08 +0100 > Antonio Angelino <[email protected]> wrote: > >> Hello, >> >> I am a new user of log4j package and I have a problem using rollingPolicy, >> this is the warning message: >> >> *log4j:WARN Unrecognized element rollingPolicy* >> >> >> JAR included in buid path: >> >> - log4j-1.2.15.jar >> - apache-log4j-extras-1.0.jar >> >> - commons-logging-1.1.1.jar >> - commons-logging-adapters-1.1.1.jar >> - commons-logging-api-1.1.1.jar >> - and others... >> >> log4j.xml file: >> >> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> >> <appender name="stdout" class="org.apache.log4j.ConsoleAppender"> >> <layout class="org.apache.log4j.PatternLayout"> >> <param name="ConversionPattern" >> value="%d [%t] %5p %c{1}:%L - %m%n" /> >> </layout> >> </appender> >> <appender name="ROLL" class="org.apache.log4j.RollingFileAppender"> >> <param name="file" value="log/example.log"/> >> <param name="append" value="true" /> >> <param name="encoding" value="UTF-8" /> >> <rollingPolicy >> class="org.apache.log4j.rolling.TimeBasedRollingPolicy"> >> <param name="fileNamePattern" value="log/example.%d.log.gz" /> >> </rollingPolicy> >> <layout class="org.apache.log4j.PatternLayout"> >> <param name="ConversionPattern" value="%d [%t] %5p (%F:%L) - >> %m%n" /> >> </layout> >> </appender> >> <logger name="com.mansydis"> >> <level value="debug"/> >> </logger> >> <root> >> <level value="info" /> >> <appender-ref ref="stdout" /> >> <appender-ref ref="ROLL" /> >> </root> >> </log4j:configuration> >> >> >> >> I followed log4j documentation but I don't understand why rollingPolicy is >> not accepted by log4j. >> >> What is wrong in my configuration file? >> >> >> Thank you in advance for your help, >> >> Antonio. >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
