All,

I am programmatically using log4j with a DailyRollingFileAppender. When using a prop file, I can change my computers date and the log file will rollover with yesterday's date:

log.html becomes 2009-08-16-log.html

However, when doing this programmatically, the log file does not rollover when I change my computers data.
What am I doing wrong here?

Java Code:
public static void main(String[] args){
 
	
		
		Logger log = Logger.getLogger(Test.class);
		log.setAdditivity(false);
		
		Layout html = new HTMLLayout();
		FileAppender info = null;
		FileAppender error = null;
		try {
			info = new DailyRollingFileAppender(html,"info.html","'.'yyyy-MM-dd");
			error = new DailyRollingFileAppender(html,"error.html","'.'yyyy-MM-dd");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		info.setLayout(html);
		info.setAppend(true);
		info.setImmediateFlush(true);
		
		
		error.setLayout(html);
		error.setAppend(false);
		error.setImmediateFlush(true);
		
		
		log.addAppender(error);
		log.addAppender(info);
		
		log.info("hi");
		log.error("bye");
	}

Here is the log4j.properties file
Java Code:
#1.here we attach the fileAppender to the rootlogger
#comment out to stop logging.
log4j.rootLogger=ALL,fileAppender,errorAppender

log4j.category.infoDest=INFO
log4j.category.errorDest=ERROR

log4j.additivity.infoDest=false
log4j.additivity.errorDest=false

#2.here we actually define the file appender
#comment out to stop logging.
log4j.appender.fileAppender=org.apache.log4j.DailyRollingFileAppender
log4j.appender.errorAppender=org.apache.log4j.DailyRollingFileAppender


#for hibernate purposes
log4j.logger.org.hibernate=off





#daily rolling log file appender


log4j.appender.fileAppender.File=info.html
log4j.appender.fileAppender.ImmediateFlush=true
log4j.appender.fileAppender.Append.true
#log4j.appender.fileAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.fileAppender.layout=org.apache.log4j.HTMLLayout
log4j.appender.fileAppender.layout.Title=Data Loading
log4j.appender.fileAppender.Threshold=info
log4.appender.fileAppender.DatePattern="'.'yyyy-MM-dd"
#log4j.appender.fileAppender.layout.conversionPattern='%d', "%m", '%c', '%p'

#another daily rolling file appender
###########################################
log4j.appender.errorAppender.File=error.html
log4j.appender.errorAppender.ImmediateFlush=true
log4j.appender.errorAppender.Append.true
#log4j.appender.fileAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.errorAppender.layout=org.apache.log4j.HTMLLayout
log4j.appender.errorAppender.layout.Title=Data Loading
log4j.appender.errorAppender.Threshold=error
log4.appender.errorAppender.DatePattern="'.'yyyy-MM-dd"