NLog.LogFactory.Flush C# (CSharp) Method

Flush() public method

Flush any pending log messages (in case of asynchronous targets).
public Flush ( ) : void
return void
        public void Flush()
        {
            this.Flush(defaultFlushTimeout);
        }

Same methods

LogFactory::Flush ( AsyncContinuation asyncContinuation ) : void
LogFactory::Flush ( AsyncContinuation asyncContinuation, System.TimeSpan timeout ) : void
LogFactory::Flush ( AsyncContinuation asyncContinuation, int timeoutMilliseconds ) : void
LogFactory::Flush ( System.TimeSpan timeout ) : void
LogFactory::Flush ( int timeoutMilliseconds ) : void

Usage Example

Example #1
0
 /// <summary>
 /// Flushes the output (if <see cref="DisableFlush"/> is not <c>true</c>) buffer with the default timeout of 15 seconds.
 /// </summary>
 public override void Flush()
 {
     if (!DisableFlush)
     {
         if (LogFactory != null)
         {
             LogFactory.Flush();
         }
         else
         {
             LogManager.Flush();
         }
     }
 }
All Usage Examples Of NLog.LogFactory::Flush