public DynamicFileAppender(string loggerName, string appenderName, string logfileName, string conversionPattern, string levelName = "ALL") { _loggerName = loggerName; _appender = FileAppenderFactory.CreateFileAppender(appenderName, logfileName, conversionPattern); FileAppenderFactory.AddAppender(loggerName, levelName, _appender); _log = LogManager.GetLogger(loggerName); }
public void Dispose() { _appender.Close(); FileAppenderFactory.RemoveAppender(_loggerName, _appender); _log = null; }