I'm working on configuring a RollingFileAppender in log4net programmatically. I have something like this currently:
RollingFileAppender fa = new RollingFileAppender();
fa.AppendToFile = true;
fa.RollingStyle = RollingFileAppender.RollingMode.Date;
fa.DatePattern = "yyyyMMdd";
fa.StaticLogFileName = true;
// Set more properties and add the appender to the root repository
This refuses to roll the log based on date. If I switch the RollingStyle to Size or Composite, it will then roll, but only size based, not date based. I've tried removing the StaticLogFileName and playing around with the DatePattern to no avail.
I have to configure this programmatically, as I don't know the number of appenders at runtime, so configuring it using XML, which I've been able to get working in the past, is a no-go. Anybody got any ideas? Am I missing something?