/// <summary> /// Closes the appender and releases resources. /// </summary> /// <remarks> /// <para> /// Releases any resources allocated within the appender such as file handles, /// network connections, etc. /// </para> /// <para> /// It is a programming error to append to a closed appender. /// </para> /// </remarks> protected override void OnClose() { lock (this) { if (m_appenderAttachedImpl != null) { m_appenderAttachedImpl.RemoveAllAppenders(); } } }
/// <summary> /// Removes all previously added appenders from this appender. /// </summary> /// <remarks> /// <para> /// This is useful when re-reading configuration information. /// </para> /// </remarks> public virtual void RemoveAllAppenders() { lock (this) { if (_mAppenderAttachedImpl != null) { _mAppenderAttachedImpl.RemoveAllAppenders(); _mAppenderAttachedImpl = null; } } }
/// <summary> /// Remove all previously added appenders from this Logger instance. /// </summary> /// <remarks> /// <para> /// Remove all previously added appenders from this Logger instance. /// </para> /// <para> /// This is useful when re-reading configuration information. /// </para> /// </remarks> public virtual void RemoveAllAppenders() { m_appenderLock.AcquireWriterLock(); try { if (m_appenderAttachedImpl != null) { m_appenderAttachedImpl.RemoveAllAppenders(); m_appenderAttachedImpl = null; } } finally { m_appenderLock.ReleaseWriterLock(); } }
protected override void OnClose() { appenders.RemoveAllAppenders(); base.OnClose(); }