NLog.LogFactory.Dispose C# (CSharp) Méthode

Dispose() public méthode

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Résultat void
        public void Dispose()
        {
            this.Dispose(true);
            GC.SuppressFinalize(this);
        }

Same methods

LogFactory::Dispose ( bool disposing ) : void

Usage Example

Exemple #1
0
 private static void TurnOffLogging(object sender, EventArgs args)
 {
     // Reset logging configuration to null; this causes old configuration (if any) to be
     // closed.
     InternalLogger.Info("Shutting down logging...");
     if (Configuration != null)
     {
         Configuration = null;
         factory.Dispose();      // Release event listeners
     }
     CurrentAppDomain = null;    // No longer part of AppDomains
     InternalLogger.Info("Logger has been shut down.");
 }