It may only roll if it isn't stopped. In order for your test to work log4j would have to look in the log file to see when the last log was written or check the modified date of the log file.
On 2/1/07, Todd Nine <[EMAIL PROTECTED]> wrote:
Hi all, I'm having some trouble with DailyRollingFileAppender. I'm using log4j 1.2.14, and I'm trying to get the logs to roll at midnight. I perform the following steps to test log rolling, and they don't appear to be creating the new logs correct. 1. I start Tomcat, perform some requests to generate some log data 2. Stop tomcat 3. Set my system date to tomorrow 4. Restart Tomcat and perform more requests to generate logging. However, the logs don't roll in step 4 as I expect them to. I have included my log4j.xml, any help would be greatly appreciated. Thanks, Todd <log4j:configuration> <appender name="TOMCAT" class="org.apache.log4j.DailyRollingFileAppender "> <param name="File" value="${catalina.home}/logs/tomcat.log."/> <param name="DatePattern" value="'.'yyyy-MM-dd"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} [%t] %-5p %c - %m%n"/> </layout> </appender> <appender name="OLB" class="org.apache.log4j.DailyRollingFileAppender"> <param name="File" value="${catalina.home}/logs/olb.log"/> <param name="DatePattern" value="'.'yyyy-MM-dd"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} [%t] %-5p %c - %m%n"/> </layout> </appender> <appender name="EPAY" class="org.apache.log4j.DailyRollingFileAppender"> <param name="File" value="${catalina.home}/logs/epay.log"/> <param name="DatePattern" value="'.'yyyy-MM-dd"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} [%t] %-5p %c - %m%n"/> </layout> </appender> <appender name="MBR" class="org.apache.log4j.DailyRollingFileAppender"> <param name="File" value="${catalina.home }/logs/memberservices.log"/> <param name="DatePattern" value="'.'yyyy-MM-dd"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} [%t] %-5p %c - %m%n"/> </layout> </appender> <category name="com.purdueefcu.epay"> <priority value="ERROR"/> <appender-ref ref="EPAY"/> </category> <category name="com.purdueefcu.onlinebanking"> <priority value="ERROR"/> <appender-ref ref="OLB"/> </category> <category name="com.purdueefcu.memberservices"> <priority value="ERROR"/> <appender-ref ref="MBR"/> </category> <root> <priority value="ERROR"/> <appender-ref ref="TOMCAT"/> </root> </log4j:configuration>
-- James Stauffer http://www.geocities.com/stauffer_james/ Are you good? Take the test at http://www.livingwaters.com/good/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]