Have Log4Net configured in our application to use a date stamped name and a 10Meg file size limit.
This automatically causes a rollover to a new file at midnight and whenever the 10Meg limit is reached. I would also like to roll over the logging to a new file each time the application is started (or closed).
Can I get all three roll over behaviours?
Have Log4Net configured in our application to use a date stamped name and a
Share
Set appendToFile to false in your config file.
EDIT: To answer Craig’s comment:
If you properly setup StaticLogFileName and CountDirection (see http://logging.apache.org/log4net/release/sdk/log4net.Appender.RollingFileAppender.html for more), then things roll as desired. We programmatically configure the logger in our app where we use this, but this is what the code looks like: