I would like to create a log4net RollingFileAppender that creates a new file each time the program starts. It can roll if the file gets to big but must roll each time the application is started. The appender should not be added if another appender is configured in the configuration. In essence creating a default log configuration that can be overridden by changing the configuration file.
C# – Configure log4net RollingFileAppender in code rolling once per application start
clog4netnet
Best Answer
After piecing together a number of other posts, I finally got this working. The implementation is in a static wrapper class. All you have to do is paste this code into your app, set the location to create the file, and call Log.Configure() when the application starts.