For the longest time I’ve been aggravating over a Log4Net problem using the RollingFileAppender with a RollingStyle of “Date”. This is probably the most popular style of logging, with the log file rolling over every day. But, I could never get it to work consistently. Log4Net would always start the log file over each day, but would not always archive the previous day’s log. End result being the entire log from the day before was gone! Not the best result. It would archive about once a week, so that meant this wasn’t a permissions issue. This had been going one for a year or so after an upgrade to a NHibernate 1.0 release, previous to that, everything was fine.

With the NetworthIQ move to a new, dedicated server last month, I was able to move the log directory outside of the web root (yeah, I know, you shouldn’t have logs in your web root, but they were protected). All of a sudden, the rolling is working again, with no lost logs. I guess there’s a conflict between IIS and Log4Net somewhere, maybe someone knows the exact reason, but for now I’m happy to have it working.