Proper way to shutdown a logger instance in log4Net

This worked for me:

log.Logger.Repository.Shutdown();

or you can take the long route:

foreach (log4net.Appender.IAppender app in log.Logger.Repository.GetAppenders()) {
    app.Close();
}

In this instance, as you are not sharing any appenders, you should be able to use the IAppender.Close() method on all the appenders attached to your logger (this will also cause them all to be flushed).

You should cast the logger to IAppenderAttachable and get the appenders form there; this will allow you to make sure you only call Close() on the top level of your nested appenders. This should cause them to flush and close down their own children in the correct order.

http://logging.apache.org/log4net/release/sdk/html/M_log4net_Appender_IAppender_Close.htm

This will be very dangerous if you are using a standard log4net setup with a configuration!