public override void ActivateOptions() { InternalLogHelper.WriteLog("MemoryOptimizedAppender->ActivateOptions"); MemoryCacheQueue.Instance().RemoteAddress = RemoteAddress; MemoryCacheQueue.Instance().ErrorHandler = ErrorHandler; MemoryCacheQueue.Instance().Initialize(); base.ActivateOptions(); MemoryCacheQueue.Instance().StartDequeueWorkerThread(); /*Queue初始化完成后开始工作者线程*/ }
protected override void OnClose() { try { base.OnClose(); MemoryCacheQueue.Instance().DoClean(); } catch (Exception ex) { LogLog.Error(typeof(MemoryOptimizedAppender), ex.ToString()); InternalLogHelper.WriteLog(ex.ToString()); } }
public override bool Flush(int millisecondsTimeout) { MemoryCacheQueue.Instance().Flush(); return(base.Flush(millisecondsTimeout)); }
protected override void Append(LoggingEvent loggingEvent) { MemoryCacheQueue.Instance().Enqueue(loggingEvent.RenderedMessage); }