예제 #1
0
 /// <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;
         }
     }
 }
예제 #3
0
파일: Logger.cs 프로젝트: bzmework/log4net
 /// <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();
     }
 }
예제 #4
0
 protected override void OnClose()
 {
     appenders.RemoveAllAppenders();
     base.OnClose();
 }