示例#1
0
        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初始化完成后开始工作者线程*/
        }
示例#2
0
 protected override void OnClose()
 {
     try
     {
         base.OnClose();
         MemoryCacheQueue.Instance().DoClean();
     }
     catch (Exception ex)
     {
         LogLog.Error(typeof(MemoryOptimizedAppender), ex.ToString());
         InternalLogHelper.WriteLog(ex.ToString());
     }
 }
示例#3
0
 public override bool Flush(int millisecondsTimeout)
 {
     MemoryCacheQueue.Instance().Flush();
     return(base.Flush(millisecondsTimeout));
 }
示例#4
0
 protected override void Append(LoggingEvent loggingEvent)
 {
     MemoryCacheQueue.Instance().Enqueue(loggingEvent.RenderedMessage);
 }